News:

Looking for documentation? Take a look on our wiki

Main Menu

How to translate customfields?

Started by patrik60, April 05, 2012, 16:32:11 PM

Previous topic - Next topic

rvbgnu

Yes, I know. Very frustrating not to find it... I am still upgrading my php and Joomla programming skills, so I will eventually.
But in the meantime, the website will not look good.

A work around will be to have something else that a menu: text area, radio button, ...
Best Regards, Hervé Boinnard - Irish Time (GMT)
Joomla! multilingual website and online business made easy - https://www.puma-it.ie

3D Secure v1 (3DS1) & Strong Customer Authentication (SCA)! Stripe.com payment plugin for VirtueMart 3: https://www.puma-it.ie/en/joomla-and-virtuemart-extensions/stripe-for-virtuemart
Authipay (AIB Merchant Services) for VirtueMart 2 & 3: https://www.puma-it.ie/en/joomla-and-virtuemart-extensions/authipay-aib-merchant-services-for-virtuemart

DarthVaderNow

hi,

i have found a workaround. this is a manual solution and works for me. but is a bug in vmart (if exists price modification in custom field - translations does not work!)

solution:
in file: administrator/components/com_virtuemart/models/customfields.php:623
                       
            //   ORIGINAL:   $group->display = VmHTML::select('customPrice['.$row.']['.$group->virtuemart_custom_id.']',$group->options,$default->custom_value,'','value','text',false);
            // REPAIR (translations are in language overrides)
            $MMMtemp = '';
       $MMMtemp = VmHTML::select('customPrice['.$row.']['.$group->virtuemart_custom_id.']',$group->options,$default->custom_value,'','value','text',false);
            $MMMtemp = str_replace('COM_CUSTOM_FIELD_DOLZINA_ROKAVA_KRATKI',JText::_('COM_CUSTOM_FIELD_DOLZINA_ROKAVA_KRATKI'), $MMMtemp);
            $MMMtemp = str_replace('COM_CUSTOM_FIELD_DOLZINA_ROKAVA_DOLGI',JText::_('COM_CUSTOM_FIELD_DOLZINA_ROKAVA_DOLGI'), $MMMtemp);
            $group->display = $MMMtemp;

hope this helps (took me 7 hours to reverse engineere that with firebug)...

matic

rvbgnu

Thanks for getting closer, but I have tens of constants in language overrides  :'(

But I think there is some translation methods missing in
administrator/components/com_virtuemart/helpers/html.php,
for example line 335 (public function select), it is where the menu drop down (html tags select / option).
But a simple JText::_() doesn't help here, unfortunately.
Best Regards, Hervé Boinnard - Irish Time (GMT)
Joomla! multilingual website and online business made easy - https://www.puma-it.ie

3D Secure v1 (3DS1) & Strong Customer Authentication (SCA)! Stripe.com payment plugin for VirtueMart 3: https://www.puma-it.ie/en/joomla-and-virtuemart-extensions/stripe-for-virtuemart
Authipay (AIB Merchant Services) for VirtueMart 2 & 3: https://www.puma-it.ie/en/joomla-and-virtuemart-extensions/authipay-aib-merchant-services-for-virtuemart

Zegenrijk

SOLVED

Change in: /administrator/components/com_virtuemart/models/customfields.php

Line 870
OLD:
$productCustom->text = $productCustom->custom_value . ' ' . $price;

NEW:
$productCustom->text =  JText::_ ($productCustom->custom_value) . ' ' . $price;

In your product give as a value of the custom field by example: COM_VIRTUEMART_COLOR_BLACK
In the language overrides you give the translations of COM_VIRTUEMART_COLOR_BLACK

Of course, nicer is it that you can translate this fields in the same way as you can translate the productname/product description in another language.