News:

Looking for documentation? Take a look on our wiki

Main Menu

Translating Custom Fields

Started by jjk, January 20, 2012, 22:05:10 PM

Previous topic - Next topic

jjk

I'll try to explain the steps to do this below. In this example I will describe how to add a custom field for a fine art website, where the custom field title is "Dimensions" (english) and then translate it into "Abmessungen" (german).

1. When setting up the custom field, instead of entering "Dimensions" as a title, enter "COM_VIRTUEMART_ART_DIMENSIONS" (without the double quotes).

2. If you have i.e. English and German languages installed in Joomla 1.7.x, locate your frontend language files - 'Overrides' folder. There should be an 'en-GB.override.ini' file already that contains only the usual header information for language files but doesn't contain language keys/strings yet (unless you added some overrides already). You can create a copy of this file, rename it to 'de-DE.override.ini' and place it into this folder too. (Note: You have to use an editor that is configured to save the files as "UTF-8 without BOM, i.e. the Notepad++ editor)

3. In your en-GB.override.ini enter the line (including the double quotes):
COM_VIRTUEMART_ART_DIMENSIONS="Dimensions"

4. Save the file encoded as UTF-8 without BOM

5. In your de-DE.override.ini enter the line (including the double quotes):
COM_VIRTUEMART_ART_DIMENSIONS="Abmessungen"
Note: The left part in capital letters is the Key, the right part after the equal sign is the String.

6. Save the file encoded as UTF-8 without BOM

You are done! When you switch now from the english to the german product description, you should now see your custom field translation.  ;)

Screenshots of the result below (after adding some more custom fields)...

Update:
Since version 2.0.6 the values are also translatable
So it is possible to have i.e.:

Color: red (english)
Farbe: rot (german)

You must add your values into an INI file
But some strings are hard to convert, you can for example use:

SIZE30_VALUE="30 CM"
SIZE70_VALUE="70 CM"

...and in your customfields you must then use

SIZE30_VALUE
SIZE70_VALUE

Update:
For Virtuemart 3 you can also use this available plugin to get translatable custom fields without language keys:
http://extensions.virtuemart.net/products/multilingual-translatable-custom-fields-detail

[attachment cleanup by admin]
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations