Using I18n Taxonomy and Entity Translation:

Translate some terms, using the "Localize Terms" setting.

Using the "Plain text (localized)" formatter for the taxonomy-reference field, localized terms aren't shown on localized versions of nodes. At least, not in the entity-translation language - they're shown in the site-interface language.

It's because $language->language is always the detected site-interface language.

When using content_translation.module, there's only interface language, there's no content language. Entity Translation adds another language_content global, which is what should be used to return the localized versions of terms in a taxonomy reference field.

The problem is that i18n_language() doesn't return the content language but the user-interface language, if no language-code is passed into that function.

I'm working around it by replacing $language->language with $GLOBALS['language_content'] on lines 220 and 230 of i18n_taxonomy.module.

I considered updating the i18n_language() function, but in most cases that function really should return the interface language rather than the content language. I suppose that a boolean argument for content could be added to that function, in order to return the right language based on that context, but I'm not familiar enough with the bootstrap phase and the node.module to really have been able to write all the right condition tests into the language_content part of the function.

Comments

jose reyero’s picture

Status: Active » Closed (duplicate)

Agree with i18n_language() needing some improvements but instead of changing it, I've created some others.

This will be part of a broader change, see #1531002: Use proper content/interface/context language everywhere.

However about using content language or interface language, I think everything is a bit confusing and we should display values in whatever interface language the user is seeing the page in.

(The whole concept is completely fucked up IMHO and we should have a single page language for displaying values, I'll think about creating a broader issue).

jose reyero’s picture

Issue summary: View changes

Capitalization and spelling. Specific vocabulary-name.