News:

Support the VirtueMart project and become a member

Main Menu

Translation of search area Products (VM2)

Started by agps, August 23, 2012, 12:05:10 PM

Previous topic - Next topic

agps

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.

jjk

#1
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
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

CE WebDesign München

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
CE WebDesign München: https://ce-webdesign.de | Websites, eCommerce WebShops | Responsive Design | SEO

jjk

Thank you for this. Works for me, too. I'll suggest it be included in the core.  :)
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

alatak