News:

Looking for documentation? Take a look on our wiki

Main Menu

BUG: Language not being applied to custom fields

Started by Jason Farmer, November 02, 2012, 12:43:43 PM

Previous topic - Next topic

bombayx

Quote from: jjk on April 08, 2014, 21:27:29 PM
The english language keys/strings for Mr. and Mrs. are in the file your-root-folder\components\com_virtuemart\language\en-GB\en-GB.com_virtuemart_shoppers.ini
Search for:
COM_VIRTUEMART_SHOPPER_TITLE_MISS="Miss"
COM_VIRTUEMART_SHOPPER_TITLE_MR="Mr"
COM_VIRTUEMART_SHOPPER_TITLE_MRS="Mrs"

If those are not yet in your (slovak?) xx-XX.com_virtuemart_shoppers.ini, just copy the above keys/strings into it and replace the strings (for example "Miss") with the salutations in your language.

Maybe you don't get my point, here, how can I translate to a second language that string? This string is shown on he site ...

Joomla 2.5.19
PHP 5.5
multi-language shop

jjk

Sorry, I misunderstood your question. If you want to translate 'Velkost', you have to enter a language key. Instead of 'Velkost' enter something like com_virtuemart_velkost. Then go to your Joomla language file override folders or use the Joomla language manager and add that key followed by a string to your english and (slovak?) override files.

For example:
COM_VIRTUEMART_PRODUCT_SIZE="Velkost" (place this one into the (slovak?) site and perhaps also into the administrator language override files)

COM_VIRTUEMART_PRODUCT_SIZE="Size" (place this one into the (english) site and perhaps also into the administrator language override files)

It is pretty similar to the way described in this tutorial (which is now obsolete concerning the Mr./Mrs. translation):
http://docs.virtuemart.net/tutorials/36-multilingual-store/105-using-language-keys-in-form-fields.html
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

bombayx

Quote from: jjk on April 08, 2014, 22:35:59 PM
Sorry, I misunderstood your question. If you want to translate 'Velkost', you have to enter a language key. Instead of 'Velkost' enter something like com_virtuemart_velkost. Then go to your Joomla language file override folders or use the Joomla language manager and add that key followed by a string to your english and (slovak?) override files.

For example:
COM_VIRTUEMART_PRODUCT_SIZE="Velkost" (place this one into the (slovak?) site and perhaps also into the administrator language override files)

COM_VIRTUEMART_PRODUCT_SIZE="Size" (place this one into the (english) site and perhaps also into the administrator language override files)

It is pretty similar to the way described in this tutorial (which is now obsolete concerning the Mr./Mrs. translation):
http://docs.virtuemart.net/tutorials/36-multilingual-store/105-using-language-keys-in-form-fields.html

Many thanks. Worked!
Joomla 2.5.19
PHP 5.5
multi-language shop

taenny

Hello,

I had the exact same question - thanks for sharing the answer!

I am also trying to translate all available values of my custom field for both front- and backend - in the example above represented by "XXS" etc, which I already named according to my own needs COM_VIRTUEMART_PRODUCT_USED,...
Translation of the title works well by placing it in the joomla language override section in the backend. Doing the same thing for the values of my custom field doesn't do the trick.

There is a thread in here (even sticky), which describes this scenario (http://forum.virtuemart.net/index.php?topic=96758.0) but I failed to locate the "ini" file, in which I am supposed to write my strings into. (tried xx-XX.com_virtuemart_shoppers.ini)
I also tried inserting those language keys into the joomla language override folder (/mydomain/language/overrides) with no effect.
Joomla Version: 2.5.18
VM Version: 2.6.0

Am I missing something? Any hints would be very much appreciated!
Vm Version: 2.6.12.2
Joomla: 2.5.27
Php: 5.5
MySQL: 5.5

taenny

Resolved it on my own but I guess it is only a workaround.
Since no type of language override  (neither file nor backend entries) worked for the custom field values (Type:String, Is a list) I took a look at the code.

I created a template override for the productdetails view and changed in default_customfields.php around line 39

<?php echo $field->display ?> to <?php echo JText::_($field->custom_value); ?>

Creating a language override now takes effect.
Still wonder though, whether this is truly necessary..

I know this thread is in the bug report section and this is obviously no bug per se but I thought others might also run into this when using default templates.
Vm Version: 2.6.12.2
Joomla: 2.5.27
Php: 5.5
MySQL: 5.5

Milbo

Quote from: taenny on April 19, 2014, 17:45:55 PM

I am also trying to translate all available values of my custom field for both front- and backend - in the example above represented by "XXS" etc, which I already named according to my own needs COM_VIRTUEMART_PRODUCT_USED,...
Translation of the title works well by placing it in the joomla language override section in the backend. Doing the same thing for the values of my custom field doesn't do the trick.

should be in the frontend language.


Quote from: taenny on April 27, 2014, 20:43:40 PM
Resolved it on my own but I guess it is only a workaround.
Since no type of language override  (neither file nor backend entries) worked for the custom field values (Type:String, Is a list) I took a look at the code.

I created a template override for the productdetails view and changed in default_customfields.php around line 39

<?php echo $field->display ?> to <?php echo JText::_($field->custom_value); ?>

Creating a language override now takes effect.
Still wonder though, whether this is truly necessary..

I know this thread is in the bug report section and this is obviously no bug per se but I thought others might also run into this when using default templates.


Seems that the vmText is missing for type string, "is a list".
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/