Vocabulary name translation

David Lesieur - August 26, 2005 - 02:16
Project:Internationalization
Version:6.x-1.1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

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

David Lesieur - August 26, 2005 - 02:59

I've been thinking about this (for a brief moment, that is). If I follow my second suggestion, the logical result could be:

  • A new database table i18n_vocabulary (with trid and vid columns).
  • Some interface to edit that table (e.g. to edit "vocabulary translations").
  • The column "change translation" of the page admin/taxonomy/i18n/term would still show the available terms for each language, but those terms would be retrieved from the related vocabulary, according to the table i18n_vocabulary. If no such relation existed, the behavior would remain the same as it currently is (showing the terms from within the same vocabulary).

#2

jozef - October 11, 2005 - 13:15

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

David Lesieur - October 14, 2005 - 19:43

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

mgifford - December 9, 2005 - 04:02
Status:active» needs review

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

AttachmentSize
vocab_term_patches.tar.gz 3.98 KB

#5

sungkhum - May 23, 2006 - 05:46

Will this work in 4.7.0?

Thanks,
Nathan

#6

Jose Reyero - February 22, 2008 - 16:28
Version:4.6.x-1.x-dev» 5.x-2.x-dev
Status:needs review» won't fix

This version is not supported anymore, we'll consider this for versions 5.x or 6.x...

#7

peashooter - September 11, 2009 - 07:52
Version:5.x-2.x-dev» 6.x-1.1
Status:won't fix» active

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

mfb - September 15, 2009 - 16:16
Status:active» needs review

Here's a start on vocabulary name translation on the node/add pages.

AttachmentSize
vocabulary.patch 985 bytes

#9

Jose Reyero - November 5, 2009 - 18:05
Status:needs review» duplicate

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)

 
 

Drupal is a registered trademark of Dries Buytaert.