1

I am looking for a solution through which Vocabulary name can be translated. I'm using the i18n module with latest D7.

Currently I have chosen the option like so:

Translate. Different terms will be allowed for each language and they can be translated.

Here is a screenshot to illustrate that option:

enter image description here

I am able to translate terms of this vocabulary as shown in the screenshot below:

enter image description here

Problem Statement: How can I translate the vocabulary name, i.e. "Test Vocabulary English" in my example above.

2

Typical taxonomy translation issues

My best guess is that you are experiencing the typical taxonomy translation issues, as described in the community documentation about Taxonomy translation also. While digesting that, you may want to verify one of its comments, which is about using the Title module also.

The closest I have come so far with translated terms (and without using the Title module), is similar to the setup you have done so far. The result of it being that when you want to select a term from a taxonomy on a language specific node, you get a list of all terms to select from (with all terms from all languages). Not the ideal solution, but similar to what is written in the URL I mentioned, and probably "as good as it gets in D7".

Translate vocabulary name

If however you're only looking for a way to translate the vocabulary name (as the title of your question indicates), then be aware that that is simply not possible today, and is actually a known issue: Vocabulary Name value doesn't get translated. It dates from 2005 (!), related to D6, status "won't fix". However comment # 2 in that issue states:

I have used the locale module to translate the name of the vocabulary, and display it with t($vocabulary->name). If all modules would display the name this way (e.g. taxonomy_menu does it), then there is no need for a new database table i18n_vocabulary.

The t($vocabulary->name) seems like a possible/partial work around to consider, i.e. from within a (custom) module.

There is a more recent similar issue, i.e. Vocabulary names are not translated. That one is for D7, with status "needs work".

Another potential work around could be to have a separate taxonomy for each language (and with a "name" corresponding to that language). Of course, you'd have to think how to best use these separated taxonomies for each content type (a kind of "solution to the problem, changes the problem) ...

  • Thanks for the help! But Title module again gives the facility to make term title translatable not for the Vocabulary field (Copied from the comment: Then you can translate your terms one at at time at taxonomy/term/{term ID}/translate.) – Pushpinder Rana Jun 10 '15 at 8:07
  • Thanks for your time. I've added screenshot in summary, hopefully will help you to understand the problem statement. – Pushpinder Rana Jun 10 '15 at 11:15
  • Thanks for pointing out me in right direction, it seems to be a known issue at least now I can look for another solution. Thanks, I appreciate your time. – Pushpinder Rana Jun 11 '15 at 5:22
0
global $language;
$vid = 1; //sample
$vocabulary = taxonomy_vocabulary_load_multiple(array($vid));
$vname = i18n_taxonomy_vocabulary_name($vocabulary[$vid], $language->language);

You need to have Taxonomy translation (i18n_taxonomy) installed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.