VirtueMart Forum

VirtueMart 2 + 3 + 4 => Language/Translations => Topic started by: agps on August 23, 2012, 12:05:10 PM

Title: Translation of search area Products (VM2)
Post by: agps on August 23, 2012, 12:05:10 PM
Hi,

I would like to translate the label "Products" on the search results page. There are a line of check boxes like articles, contacts .... and products. The constant of articles is JGLOBAL_ARTICLES but I can not find the constant for products.
Title: Re: Translation of search area Products (VM2)
Post by: jjk on August 23, 2012, 22:13:31 PM
The "Products" is generated from \plugins\search\virtuemart\virtuemart.php. The other search filter options are from Joomla search plugins and their language files.
The solution should be something like replacing "Products" with JText::_('COM_VIRTUEMART_SEARCH_PRODUCTS') in line 30 of the file YourJoomlaRoot\plugins\search\virtuemart\virtuemart.php.
But just doing that and adding the corresponding key/string i.e. to the _mod.virtuemart_search.ini didn't work for me (I always got a syntax error).

Seems to be too complicated for me (php-illiterate)  :) ...let me know if you manage to get it working.

PS: Problably plugin files to translate plugin text are have to be created, in this case i.e:

administrator\language\en-GB\en-GB.plg_search_virtuemart.ini
administrator\language\en-GB\en-GB.plg_search_virtuemart.sys.ini
Title: Re: Translation of search area Products (VM2)
Post by: CE WebDesign München on September 29, 2012, 18:19:07 PM
hi,

this works for me (inspired by" \plugins\search\contact\contact.php"):

in "\plugins\search\virtuemart\virtuemart.php"  change line 25-33 (old):


   class plgSearchVirtuemart extends JPlugin
   {
      function onContentSearchAreas() {

         static $areas = array(
      'virtuemart' => 'Products'
         );
         return $areas;
      }
      
      
to this (new):


   class plgSearchVirtuemart extends JPlugin
   
   {
      function onContentSearchAreas() {

      $this->loadLanguage();
         static $areas = array(
      'virtuemart' => 'PLG_SEARCH_VIRTUEMART_PRODUCTS'
         );
         return $areas;
      }
      
      
and add
PLG_SEARCH_VIRTUEMART_PRODUCTS="Products"
to your en-GB.override.ini and translations to other language .ini's
Title: Re: Translation of search area Products (VM2)
Post by: jjk on September 29, 2012, 18:40:53 PM
Thank you for this. Works for me, too. I'll suggest it be included in the core.  :)
Title: Re: Translation of search area Products (VM2)
Post by: alatak on September 30, 2012, 13:43:49 PM
Hello,

txs for the tip.
Added in the core.