1

Configuration:
I set up a multilingual site with Multilingual support: Enabled, with translation so I'm creating a new node for each language.

The taxonomy term is set up with the Translation mode: Translate, so I have a new term for each language.

Creating a node with default language first is working fine:
If I create a new node in my default language using node/add/page I correctly see the taxonomy terms in the site language, then after the node is created, using the Translate tab and select the Spanish language will work correctly and display the terms in Spanish.

Creating a node in a different language:
Now if I want to create a Spanish node first and I go to node/add/page I will see the site default language for the terms, so my tid will be in English instead of Spanish even if the language switcher is correctly set to Spanish.
Then when I'll edit this node, my terms will switch back to Spanish and loose the default term I selected while creating the node.

Partial solution:
A way to avoid this problem is to go to es/node/add/page instead and now the terms are correctly in Spanish.

This solution isn't very convenient, so what is the correct way to handle this efficiently and avoid saving a Spanish node with English terms ?

1 Answer 1

0
+50

Language Selecting

There are number of ways Drupal distinguishes which language the current user is in (yourself for example).

The admin page at '/admin/settings/language/configure' lists 4 methods.

  1. None.
  2. Path prefix only.
  3. Path prefix with language fallback.
  4. Domain name only.

As you can see, to determine the language, Drupal either uses a 'path prefix', 'language fallback' and 'domain'.

The path prefix is simply something like '/de/about-us-page'. Drupal sets the language to German. When I say set, I actually mean it sets it for that particular page request. Then visiting '/about-us-page' would NOT display the language in German but your default language (maybe English).

For Language Fallback, Drupal check if the currently logged in user has a language set in their $user account. If not, it will look for a language from the headers sent from the browser. If in any case the language cannot be determined, the default language is used; again may be English.

The Domain method is simply inspecting the domain and checking if it has been mapped to a language. e.g. German to domain.de.

Conclusion

From this, you can see that Drupal is simply reverting back to the default language. You setting the 'language' within the node edit form, is simply mapping this node to that language. Usually when adding content for other languages, I switch into the native language. This ensure my taxonomy terms are mapped correctly.

Essentially, this is not a problem but the way this system works.

Possible Fix

If all the terms you are using are common to all languages, you can modify the Taxonomy translation mode to 'Localize' instead of 'Translate'. This should allow all the terms to be saved correctly even if you use the edit page without prefix 'node/add/page'. Just ensure you translate the terms using the String translation module.

Hope this help. Amarjit

1
  • Thanks for the explanation, I'm still not confident on what's the best way to handle multilingual taxonomy. I know I have to switch my locale language to create a new node but this isn't convenient and the end user won't do it leaving me with a messy content... I'll test out the localize option but I'm not sure if this would work out for free tags.
    – tostinni
    Aug 6, 2013 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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