amilenkov's picture

Hi Friends,

Is it possible to make a translation of field labels? With some Module(s) or in core? Another way?

The translation of the contents of the fields (in the nodes of each different content type) works without problems, but I cannot find a way to translate the labels themselves and they are only displayed in the original language (when they are not hidden) and cannot be translated.

Comments

amilenkov's picture

Hello again,

I manage to translate specific field label as follows:

I copied the field.tpl.php file to the theme folder and changed its name to become field-field-name.tpl.php, where "field-name" is the name of the field.

In the field-field-name.tpl.php file, I changed line 55 of the code like this:

<div class="field-label"><?php print t('My Label in Eglish:');?>&nbsp;</div>

Thus, for this field only, the $label variable is replaced with a text string "My Label in Eglish" that can be translated in other languages of that site.

And I suppose a similar method will also help in other situations where translation is not easy or still impossible. As a workaround before more multilingual options are available.