Vocabulary name translation
| Project: | Internationalization |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Problem:
The i18n module allows us to define term translations within a vocabulary that is language-independent (e.g. languages are assigned to terms belonging to a common vocabulary, and no language is assigned to that vocabulary). The vocabulary being language-independent, it has a single language-independent name. Thus, there is no way to translate the vocabulary's name when it shows up on a page. And if instead we define separate vocabularies for each language, it is fine for localizing the vocabulary names, but then there is no way to define term translations (because the current interface does not allow to define term translations across vocabularies).
Suggestions:
- Add a mechanism to translate the names of language-independant vocabularies (sounds strange).
OR
- Change the interface to allow cross-vocabulary term translations (sounds more sound, I guess).

#1
I've been thinking about this (for a brief moment, that is). If I follow my second suggestion, the logical result could be:
#2
I have used the locale module to translate the name of the vocabulary, and display it with t($vocabulary->name). If all modules would display the name this way (e.g. taxonomy_menu does it), then there is no need for a new database table i18n_vocabulary. (?)
#3
You are right, this solution works pretty well to translate vocabulary names.
A drawback I see is that renaming a vocabulary will break the translations, something that would not happen if various vocabularies where linked with a translation id (trid) in the same way terms are linked. This may not be a major drawback, though, as I guess most people do not rename vocabularies very frequently...
However, I think most modules do not use t() when displaying vocabulary names because the locale module was not really meant to translate database content, but was meant to translate a site's interface. There must be some reasons for this, otherwise why not using t() to translate terms as well?
My initial issue was in fact two rolled into one (translating terms across vocabularies _and_ translating vocabulary names), so I just posted a new issue for the former problem only (http://drupal.org/node/34113).
#4
Both $vocabulary->name & $term->name need to be patched in a number of modules. Taxonomy is a pretty critical part of Drupal.
In anycase, I've bundled together at least some changes which will use the translation t() solution which was discussed here.
I'd really like to see some better way to handle this in the future. Training folks to do this is going to be a real pain. Also, it can't be good to just keep making that array bigger and bigger.
Mike
#5
Will this work in 4.7.0?
Thanks,
Nathan
#6
This version is not supported anymore, we'll consider this for versions 5.x or 6.x...
#7
I'm also having issues translating vocabulary names.
Can I just confirm (not quite clear) that you can only translate vocabulary *names* if you set to localize terms? I don't want to translate terms, just the vocabulary name.
I've changed this to version 6.x because that's what I'm using.
Thanks
#8
Here's a start on vocabulary name translation on the node/add pages.
#9
Committed a similar one #494576: Translate tags vocablary name on node form?
Thanks
(Btw, the module is ready for a new release, some quick testing welcomed)