Hi,

I see there are a lot of issues that have been open regarding Vocabulary names not being translated. All these threads are very old and it looks like this bug has never been corrected. This looks like a basic feature that should have been corrected a long time ago...

I create a few Vocabularies in French (source language), then translate them in English using their Translate tab.
When I go to mywebsite.com/EN/admin/structure/taxonomy all Vocabularies are listed in French whereas they should be displayed in English right? Same problem when I want to list all terms of the vocabulary, I expect the admin page title to be the english translation of the vocabulary name, but it appears in French... and also in the breadcrumb when adding a term for example...

Vocabulary names are not translated in Views exposed filters either for example a Taxonomy Term View where you want to filter terms by Vocabulary. Vocabulary names always show up in source language.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nicolas Bouteille’s picture

Title: Vocabulary names are not translated in admin/structure/taxonomy » Vocabulary names are not translated
Issue summary: View changes
fugazi’s picture

same problem

lykyd’s picture

+1

sinasalek’s picture

Yes same problem here.
here is some probably related issues i found :
#1815054: Vocabulary Name translation (Name value doesn't get translated), #29697: Vocabulary Name translation (Name value doesn't get translated)
If the maintainer points me to the right direction, i think can write the patch.
So far i found the following functions, it seems that functionality is partially there :

i18n_taxonomy_vocabulary_name
i18n_taxonomy_vocabulary_description
sinasalek’s picture

Here is the first attempt, fixes the problem on this page admin/structure/taxonomy

sinasalek’s picture

Here is another approach, it fixes the problem almost everywhere. however i'm not sure whether it causes any side effects or not.
Clear Drupal cache after applying the patch

sinasalek’s picture

Version: 7.x-1.11 » 7.x-1.x-dev
Status: Active » Needs review

The last submitted patch, 5: vocabulary_translation_fix.patch, failed testing.

fugazi’s picture

It works for me..

sinasalek’s picture

Status: Needs review » Reviewed & tested by the community
Jose Reyero’s picture

Category: Bug report » Feature request
Status: Reviewed & tested by the community » Needs work

We don't translate object values when loading, just when displaying.

I think this is a new feature, and this would need tests.

gonssal’s picture

The patch works perfectly so far, thanks sinasalek.

Also, just wanted to say that's it's not possible to translate "when displaying" like you are asking to Jose. The vocabularies table is displayed in the taxonomy_overview_vocabularies() function of the core taxonomy module (taxonomy.admin.inc file), and it basically loads all the vocabularies entities, and sets the name to $vocabulary->name. So if you don't hook when the entity is loaded, you need to modify the core taxonomy module, which I don't see happening, mostly because it's i18n's responsibility to display the vocabulary names in their language.

I really don't understand why you aren't accepting hooking on load (entity translation + title works that way), but if you won't change your mind, I think you can close this because otherwise the only way I see this possible is by hooking into the pages/forms/wherever a vocabulary name appears, which is basically impossible to maintain. Also you force other modules to implement the hooks themselves, which will lead to 90% not knowing/caring and to errors when people doesn't check if i18n module/functions exist.

Jose Reyero’s picture

@gonssal

the only way I see this possible is by hooking into the pages/forms/wherever a vocabulary name appears, which is basically impossible to maintain

Guess why the feature is not yet there...

But really, if you translate entities when loading, then you risk saving them again with wrong values because you *cannot know* what the entity is being loaded for.

Anyway, you may want to try Entity Translation + Title module, maybe they figured that out already...

tlito’s picture

This patch #6 did not work for my site. I execute patch and clear cache but I see as it was: http://tlito.ru/en/categories/site-development
In the menu all right but the Title tag and Page title h1 are not translated. That problem is so unbelievable.

sinasalek’s picture

joseph.olstad’s picture

Status: Needs work » Needs review
FileSize
831 bytes

this is the exact same patch as patch #6, just re-uploaded in order to trigger the testbot that fell asleep when jenkins was brought in.
so just waking the testbot up.

joseph.olstad’s picture

for this issue, I recommend what Jose Reyero is suggesting in comment #13 as the way to go if you need this.
Entity Translation + Title module

joseph.olstad’s picture

Status: Needs review » Closed (works as designed)