Once i18n_taxonomy module is enabled it become impossible to translate terms because the translate tab link isn't displayed. Having both module enabled could be useful when translating taxonomy path with pathauto. The complete setup is described at the end of https://www.drupal.org/node/1114016 , in "Using both i18n Taxonomy translation and Entity Translation to translate your taxonomy and generate multilingual URL aliases" chapter.

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 your terms in your default language with Generate automatic URL alias [admin/structure/taxonomy/blog_categories/add]
6. Now, it is impossible to translate a term. Going to the term edit page doesn't show the 'translate' tab.
7. Disable i18n_taxonomy module.
8. Now it is possible to translate the terms, the translate tab is visible on the term edit page.

Original issue summary:

Hi,

I've setup a Drupal 7.22 install with i18n enabled, but for a couple of taxonomy-fields I needed Entity Translation.

Now, it all works at first, but now I start to notice that whenever you edit the original term the value in the table (entity_translation, not the fields) becomes 'und' (LANGUAGE_NONE), resulting in a forbidden error whenever I try to translate. The language tabs are also missing whenever I try to change the original.

Anybody got a clue how to resolve this from constantly getting back in the db whenever the term is changed?

Some more info below:

  • Drupal 7.22
  • Entity Translation 7.x-1.0-beta3+11-dev (now, but was initially 7.x-1.0-beta3, but no fix)
  • Internationalization 7.x-1.10 (was initially 7.x-1.8, but no fix)
  • Taxonomy is enabled and I got 2 vocabularies with a couple (10+) of terms each (if it might be of any concern)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

blacksnipe’s picture

Issue summary: View changes
blacksnipe’s picture

Anybody got an idea?

idflood’s picture

I've made a quick patch for this but feel this is still incomplete.

With only entity_translation: the database has the language set to 'und', but in entity_translation_tab_access the $handler->getLanguage() return 'fr' in my case since it is the translation original language.

With i18n_taxonomy enabled, the $handler->getLanguage() return 'und'. This happen because in the getLanguage function $this->entityInfo['entity keys']['language'] is defined now (it wasn't without i18n_taxonomy).

idflood’s picture

Title: Language undefined when editing original taxonomy term translation » Impossible to update taxonomy term after enabling i18n_taxonomy
Issue summary: View changes
idflood’s picture

FileSize
971 bytes

Small fix, check for $this->entity->vid.

jgullstr’s picture

The reason for this is because i18n_taxonomy resets all terms to LANGUAGE_NONE when saving a vocabulary. Since the term languages in the database are wrong, #5 would be more of a workaround than a solution IMO.

I posted an issue for this in i18n: #2366585: Saving a vocabulary resets all terms to LANGUAGE_NONE

blacksnipe’s picture

Hey,

I've tried both your patches, but none seem to solve the issue for me.

I've reviewed the temporary result and managed to cut down on the fields that need to be translated. Now it's just one left.
Too bad there's no summary for body-fields in taxonomy, hehe...

That's why I had to add another field, in order to show a separate field for the summary of the taxonomy term in a view, the description-field provided by the core is shown on the detailpage. If anybody had a workaround for this - I find it really hard to believe I'm the first one trying to solve this - PLEASE do explain how...

In the meantime I'm still... and pretty clueless (well, you can complete it ;-)).

Anyways, thanks for the effort though.

plach’s picture

Status: Active » Needs review

I guess this should be in needs review status...

plach’s picture

This could be fixed by #1661348: I18n Taxonomy integration.

plach’s picture

m.lebedev’s picture

#5 works.

plach’s picture

Status: Needs review » Reviewed & tested by the community

#5 looks good thanks.

plach’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed, thanks.

  • idflood authored cb32cfb on 7.x-1.x
    Issue #2203801 by idflood: Impossible to update taxonomy term after...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

tanius’s picture

The fix in #5 works, but keep in mind that one has to follow the second step from the issue summary to see any effect:

"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]"

If setting i18n_taxonomy to any other option, the i18n mechanism will win over entity_translation, whose language version tabs would then still not be shown on the term's edit page. Hope it helps someone out.

adam1’s picture

I am using ET 7.x-1.0-beta5. Applying patch #5 succeded, but after patch, WSOD appears and 'drush cc all' throws out

Error: Cannot redeclare
EntityTranslationTaxonomyTermHandler::getLanguage() in
…/sites/all/modules/contrib/entity_translation/includes/translation.handler.taxonomy_term.inc,
line 37

Could someone help me out?

Jorge Navarro’s picture

My solution was to disable i18n_taxonomy, everything works fine with dev versions of i18n and entity_translation and without i18n_taxonomy