Last updated September 26, 2016. Created on April 2, 2011.
Edited by vensires, Francewhoa, nlambert, Soul88. Log in to edit this page.

The Taxonomy translation (i18n_taxonomy) module, part of the Internationalization (i18n) package, provides multiple options to translate taxonomy vocabularies and terms. For each vocabulary, you'll have to choose one of four different modes defining 'multilingual' behaviors for the vocabulary:

  1. No multilingual options for terms. Only the vocabulary will be translatable. (default)
    [previously called "None"]
  2. Localize. Terms are common for all languages, but their name and description may be localized.
    [previously called "Localize terms"]
  3. Translate. Different terms will be allowed for each language and they can be translated.
    [previously called "Per language terms"]
  4. Fixed Language. Terms will have a global language and they will only show up for pages in that language.
    [previously called "Set language to vocabulary"]

When a language is set for a vocabulary or term, only those that match the current language will appear in taxonomy listings and when creating and editing nodes. If the language is set for a vocabulary, all the terms in that vocabulary will be automatically set to that language.


Figure 1: Choosing a multilingual support option per vocabulary

Localize

When using the 'Localize' option for a vocabulary, you can create terms in the site's default language, and then translate them via the 'Translate' tab for the term.

Terms are not duplicated

Translating a taxonomy term with i18n
Figure 2: Translate tab for a taxonomy term when using 'Localize' option for the vocabulary.

An important limitation of Localize terms is that when using these vocabularies as Tags, terms can only be edited and created using the default language.

Translate

Using the 'translate' option, you can associate each term in a vocabulary with a particular language.

Creating term to be translated
Figure 3: Creating a taxonomy term in a particular language.

After you've created a term, you can add new terms that will be associated with other languages and mapped to the term in the source language. These terms will have different term ids.
Translating terms using the 'Translate' option for vocabularies
Figure 4: Translating a taxonomy term using the 'Translate' option

Once we have terms and translations, only the correct terms for each language will show up while browsing the site. When we are editing a node, the terms for that node's language will be available.

Fixed Language

To create distinct vocabularies for different languages, use the Fixed Language option.

Tagging and multilingual vocabularies

Tagging (autocomplete) may not work well for vocabularies with the Translate option if terms are not unique for each language. Example: you have an English term "Drupal" and a French term "Drupal". Use a "Select list" widget for these cases.
See #1085190: Make taxonomy autocompletion work / tagging / block tagging ?

Other methods of translating taxonomy

The Entity Translation module also allows you to translate taxonomy terms, by translating individual fields on each taxonomy term. For more information, see the Entity Translation documentation page.

Using both i18n Taxonomy translation and Entity Translation to translate your taxonomy and generate multilingual URL aliases

Q. Why use both?
A. There is a problem with automatic multilingual URL alias generation using the pathauto module that this will solve.

The steps needed to achieve this are as follows:

We are using an example taxonomy called Blog Categories.

1.Add your taxonomy. e.g Blog Categories [admin/structure/taxonomy/add]
2. Configure i18n_Taxonomy aka Taxonomy translation for each taxonomy as No multilingual options for terms. Only the vocabulary will be translatable. [admin/structure/taxonomy/blog_categories/edit]
3. Enable Entity translation for taxonomy and configure the taxonomies [admin/config/regional/entity_translation]
4. Translate the Taxonomy Vocabulary name into each language [admin/config/regional/translate/translate]
5. Add URL Alias patterns for each taxonomy term {e.g. [term:vocabulary:i18n-name]/[term:name]} [admin/config/search/path/patterns]
6. Add your terms in your default language with Generate automatic URL alias [admin/structure/taxonomy/blog_categories/add]
7. Translate each taxonomy term by clicking on each language link to translate it. Every URL alias will be added using the translated Taxonomy category and your translated term translation. [admin/structure/taxonomy/blog_categories/translate]

e.g.
in English you have URL path generated as Blog-Categories/Recycling
in French you have URL path generated as Catagories-du-blog/recyclage

This works because the Entity translation is using the field translations so it picks up the translated Taxonomy term and the Blog-Category becomes Catagories-du-blog because your adding the term using the French interface so it just adds your French translation of your Taxonomy Vocabulary name. Each translated term is added as per the [term:name] token and each Taxonomy Vocabulary name is added as per the translated Taxonomy Vocabulary name from the [term:vocabulary:i18n-name] token.

There seems to be a conflict between i18n_taxonomy and Entity translation at this time:
#2203801: Impossible to update taxonomy term after enabling i18n_taxonomy
#2366585: Saving a vocabulary resets all terms to LANGUAGE_NONE

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

2dareis2do’s picture

Choosing best option for handling multilingual taxonomy. In drupal 7 there are the following options:

  1. No multilingual options for terms. Only the vocabulary will be translatable.
  2. Localize. Terms are common for all languages, but their name and description may be localized.
  3. Translate. Different terms will be allowed for each language and they can be translated.
  4. Fixed Language. Terms will have a global language and they will only show up for pages in that language.

This is great to have this flexibility but can be a little confusing (for me anyway). Here are my notes

  1. No Multilingual options - terms cannot be translated but vocabulary can be
  2. Localize - You are requested to enter taxonomy values for each language sequentially, i.e. term 1, term 1 (different language), term 2, term 2 (different language) and so on.
  3. Translate - Here you do not have to be language specific, but when you are then you have the option to translate term, enter taxonomy values sequentially i.e. term 1, term 2, term 3 etc
  4. Fixed - if you want to use completely different terms for each language by having a different vocabulary for each language.

Hope this helps someone.

balagan’s picture

You are right, it is confusing, but your version doesn't help (at least for me). It is only after reading this whole page, that it is clear for me. I guess mentioning the limitation of Localizable terms (in bold on this page) makes more sense.

Kristen Pol’s picture

The module option text has been changed to more closely match your suggestions. Note that the screenshots haven't been updated in this documentation yet. I may be able to do that in February.

Kristen

-Kristen
Blog: http://kristen.org
Drupal 7 Multilingual Sites: http://kristen.org/book

shinmaikeru’s picture

Drupal 7 Japanese-English fully bilingual site for scientific research and education organization. All content (with very, very few exceptions) is in both English and Japanese, so the tags have to be in English and Japanese, too.

Initially creating node:
I make a node in English while using the English interface.
I select Terms. The choices are the English choices.
I Save and then click Translate.
The interface remains English, but I am creating the Japanese translation of the English node I just created.
When I go to the Term selection box, the English terms are selected, and the Japanese terms are not available.

Editing pre-existing node:
I am using Japanese interface.
I go to node, hit Edit, and edit the Japanese version.
I hit Translate and then select the English version's Edit link.
I edit the English content, but the Terms are not selected, and they are not available. Only the Japanese terms are available.

It seems that the Term choices, as well as the choices for associating nodes, is filtered to match the language of the current user interface rather than the language of the node being edited.

This is a major problem, because if I edit an English node while using the Japanese interface, the associated nodes and Terms are removed when I click Save. Forcing all editors of the site to make sure they switch their interfaces to match the language of the node is not an option, because even I can't remember to do that.

tuccio’s picture

Have you tried adding to the excluded pages selection at /admin/config/regional/i18n/select ? (In section: "Enable for specific pages" try adding to the list for "All pages except those listed" as needed)

Marko B’s picture

I am using Translation option but when I want to translate term I always get
"No translatable fields"
So ok I then go and replace name of term and do " Replace name with a field instance" on fields so then I can make some translation and then I click on that term and get
The requested page "/en/taxonomy/term/108" could not be found.

And not to get started with other things all in all, multilingual is still not good in drupal 7, similar to drupal 6.

If you want to make profesional site, you would want to use and have

clean Urls
views
panels
meta tags
breadcrumbs
taxonomy
menus

and all of this is just pain in the ass when trying to work together and you will constantly have problems like panels title can't be translated, taxonomy aliasies will not work as you want them in multilang. breadcrumb needs to have separate module for menu, other for panels, other for views, other for tax.

What I suggest to others, just dont try to synch all of this. Build separate panels/views/tax./menus for each language and override language switcher to always switch to front page of language and wait for drupal 8, maybe then all of this will be working together like it should.

AlxVallejo’s picture

I'm getting the same thing. Did you find a solution?

drupalfan81’s picture

I have a multilingual site I am trying to launch to production, but I am having a rather big problem. I have everything working EXCEPT the vocabulary name itself doesn't seem to want to translate. I am using "Translate" as my method for translation and all of my terms appear in the local language when changing languages. The problem is that when using Faceted search module with these vocabularies, the vocabulary name appears in the default language (English) with all the terms translating to the local language. The Users can't use the website if the vocabulary name itself is in English, how can I fix this?

Thanks!

drupalfan81’s picture

I found a solution to this. It's a bug with Faceted Search. I thought I would share the answer here. I found this someone on drupal.org, but can't find it now, so thought I would just copy and paste from my notes.

How to fix the Faceted Search Module not translating taxonomy terms.

In the file: taxonomy_facets.module

the option to translate vocabulary names with I18N_TAXONOMY_TRANSLATE is missing.

so please change

function _taxonomy_facets_localize_vocabulary(&$vocabulary) {
// If this vocabulary supports localization.
if (module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary($vocabulary->vid) == I18N_TAXONOMY_LOCALIZE ) {
$vocabulary->name = tt("taxonomy:vocabulary:$vocabulary->vid:name", $vocabulary->name);
}
}

into
function _taxonomy_facets_localize_vocabulary(&$vocabulary) {
// If this vocabulary supports localization.
if (module_exists('i18ntaxonomy') && (i18ntaxonomy_vocabulary($vocabulary->vid) == I18N_TAXONOMY_TRANSLATE || i18ntaxonomy_vocabulary($vocabulary->vid) == I18N_TAXONOMY_LOCALIZE)) {
$vocabulary->name = tt("taxonomy:vocabulary:{$vocabulary->vid}:name", $vocabulary->name);
}
}

drupalfan81’s picture

So I have played around with this stuff for quite a bit now. But there is one thing I still haven't been able to figure out. For the Per Language Terms vocabulary, what is the reason for linking the terms using the translation tab? Basically you have a set of terms for each language in this vocabulary and those terms have a language specified. Then you can associate the terms to each other.

So the term "Car" in English is linked to the term "車" in Japanese. But why do we waste time linking these as I don't see it actually serving any purpose. For example, when I already have a content created in English with Car selected and then I go to create a translated node in Japanese of that piece of content, it doesn't load the create new translated node form with "車" selected. I have to go and select it myself? So wouldn't that be the entire point of associating the terms?

I don't get it. But on the other hand, since the localize terms are single entities but just translated, when I create a new Japanese translate node, it will prefill that field with the translated term selected (mainly because it's the same term). This makes it easier for my translators to translate content they are not fluent in, as a majority of the terms will already be selected.

The only problem I see with using localize terms, is that there is only one term name and id, and those are translated. So when they are viewed on the Japanese page, the select widget will display the terms in the default language (English) alphabetically order. So basically on the Japanese edit/new node pages, the select widget list of terms will seem to be in a strange order to the Japanese user. Since the localize terms vocabulary consists of one term name and id for all languages, I don't assume there is an easy solution to fix this problem. But does anyone know if you can control how the terms are ordered. So that they can be alphabetically for English users and alphabetically for Japanese users?

Lars Bo Jensen’s picture

Thanks for the tutorial, it helped me get the term URL aliases right on a 3-lingual site. And synchronizing terms on translations still works. Very nice!

It says so on the Entity translation project page, but I would like to point it out here as well: You must install the Title module to get this to work. Then go to Manage fields at admin/structure/taxonomy/{your-taxonomy-name}/fields and "replace" the name field. Then you can translate your terms one at at time at taxonomy/term/{term ID}/translate.

jetwodru’s picture

I found that Entity Reference module does not respect the translation made in taxonomy terms, all are still English. I just want to localize the terms for display on forms. Thanks

Marko B’s picture

I used the part from

"Using both i18n Taxonomy translation and Entity Translation to translate your taxonomy and generate multilingual URL aliases" as this seems like ultimate solution for Tax. Something with entity translation is not working properly if you have i18n taxonomy enabled, at least the DEV version.

Also to have any chance of translating something, you need to click on manage fields and replace name and description (there is a button) to make them work.

nlambert’s picture

7. Translate each taxonomy term by clicking on each language link to translate it.

I have three vocabularies. All terms have been translated with Entity translation. Things are working great. I then realize hey I have to translate the vocabulary name for my path aliases. So I enable i18n taxonomy, translate my vocabulary names, but now my terms no longer have the language tabs.

Any thoughts?

nlambert’s picture

farooq.salmani’s picture

1. Install internationalization (i18n) module. Assuming locale module is enabled and language settings are configured properly.
2. There are number of sub-modules in this module. Enable Internationalization (i18n) and Taxonomy translation (i18n_taxonomy) modules.
3. Add a vocabulary through "Structure->Taxonomy->Add vocabulary" and select the "Localize. Terms are common for all languages, but their name and description may be localized." in translation mode and click on "save and translate" button.
4. Translate the vocabulary.
5. Add the terms to this newly created vocabulary.
6. Click on "Save and translate" button while adding the term. Translate the term. Add more terms like this.
7. Create new or edit the content type that you want to categorize using this vocabulary.
8. Add a field using field type "Term reference" and select the your vocabulary as category from "vocabulary" select option and click on "Save settings" button.
9. Click on "Manage Display" tab to manage the display of fields.
10. Add content to your created content type and assign the category.
Suppose you have created "Sports" vocabulary and added two terms "Cricket" and "Football". Assign the category one of the category of sports to your content.
11. Use the "Language Switcher" block to switch the language.
I wanted to provide the screenshots as well but unfortunately I do not have permission for that. I hope this will help. You can use the other sub modules as well to translate the other parts of the site. For example: blocks, site name, site slogan etc. Internationalization module is very powerful for translation. You can also use "l10n_update" module to update the translation for core drupal interface.

doomed’s picture

For screenshots, you can just upload them somewhere else like imgur and add direct links in your post.

doomed’s picture

I believe a lot of people will be using "Localize (terms are common for all languages". It's the easiest most simple way to make this work (not saying it's the best for everyone).

Enabling it means if you have 10 terms in Language1, then Language2 will have the same exact number. Your content type doesn't even need to have taxonomy synchronization.

Just make sure every term has its translation. Then, as you make your nodes available on both Languages, each will show the correct terms (correct translations).

Note: When Editing a node (on the Drupal admin side), terms will always show on your user language (the one set on your user profile). This is a bit misleading and might throw you off at first. Don't worry, this is only on the Edit page.

So here's a small guide (adapted from the previous poster). In the following example, we create a simple Taxonomy that consists of 1 vocabulary with 3 terms:

English vocab: Sports

Terms: Soccer, Tennis, Basketball

Spanish vocab: Deportes

Terms: Fútbol, Tenis, Baloncesto

The basics:

  1. Install and enable Internationalization (i18n) module (documentation here ).
  2. Make sure Taxonomy translation (i18n_taxonomy) submodule is enabled.

Create a vocabulary:

  1. Go to "Structure -> Taxonomy -> Add vocabulary".
  2. Type the original name in English - "Sports".
  3. In translation mode, select "Localize. Terms are common for all languages, but their name and description may be localized.
  4. Click on the "Save and translate" button and add a vocabulary translation.
  5. Type the translated name in Spanish - "Deportes".

Now let's add terms:

  1. Add a new term to the Sports vocabulary. Add the original term name in English - "Soccer"
  2. Click on the "Save and translate" button and add its translation.
  3. Type the translated name in Spanish - "Fútbol".
  4. Do the same for Tennis and Basketball.

Setup the Content type:

  1. Create a new or edit an existing Content type.
  2. Click on "manage fields", add a new field called "Category", use field type "Term reference" and select "Sports" on the vocabulary selection list. Click "Save settings" button.
  3. Now click on "manage display" to configure the display of all available fields. Here you can hide labels and such. Make sure the Category field you just created has Format: "Link (localized)".
  4. If you make any changes on "manage display" don't forget to click on the Save button.

Add content:

  1. Click on Drupal's "Add content", select the correct Content type, fill in the Title, Body and assign a Category. It can be either Soccer, Tennis or Basketball.
  2. Make sure it's set to English and Publish the node.
  3. Next, let's translate this node to Spanish. You will notice on the translation page, the Category field will have the same selection you made on the English side. Publish it.
  4. Finally, check out the content. Use the "Language Switcher" block provided by the Internationalization module to switch back and forth between language versions of your content. You will see that the Soccer category will show as Fútbol on the Spanish page, Tennis as Tenis and so on...

That's it :)

mozh92’s picture

When I "Click on the "Save and translate" button and add its translation." I get next page http://take.ms/2kf5N
What am I doing wrong?

UPD
When I disabled module Entity Translation link show for me

St_B’s picture

Hi, I have to translate terms in several languages. But sometimes, there are several tranlsations in one language. Ex : abattre, in french, will be abatir in spanish, but also sacrificar, still in spanish. It seems that we can add several terms in the field, separated by a comma (the autocompletion works after the comma), but when I save, only the first word is saved, the other is not created or linked. Any idea on how to solve this problem ? Thx

sergids’s picture

After debugging the core and learning how translations work in Drupal 7, I realized term names translations cannot be obtained because function i18n_taxonomy_term_name supports only "Localize" mode.
Modes are configured in Vocabulary settings.

For people who needs "Translation" mode for translations because there are different number of terms for each language, there is not current solution to the problem unless someone fixes the issue with i18n_taxonomy_term_name function (i18n module, i18n_taxonomy submodule).

No to mention the [term:parents:join-path] token problems for pathauto module....
All workarounds described in this discussion, work for taxonomies with a depth = 1. For deeper categorizations, URLs cannot be translated because this token is required.
The issue resides with the Bulk Update functionality. Instead of using it, I suggest to save (taxonomy_term_save) all terms and let pathauto update url alias one by one.