Translating vocabulary names everywhere

sinasalek - November 20, 2009 - 17:01
Project:Internationalization
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm unable to translate vocabulary names. is this feature implemented ?

#1

G Romier - November 23, 2009 - 17:08

Same problem!
i18n 6.x-1.2
drupal 6.14

#2

jeyro - November 26, 2009 - 04:15

The same problem. Cannot translate vocabulary names.

i18n 6.x-1.2
drupal 6.14

#3

yangke - November 26, 2009 - 04:53

i work with i18n 6.x-1.1 and there vocabulary names can be translated so i suppose it should work in 6.x-1.2. (maybe a bug?)

make sure to enable 'Taxonomy translation' module

translation can be done in ' /admin/build/translate/search ' -> select taxonomy.
or you can use the translation table module at http://drupal.org/project/translation_table

#4

sinasalek - November 26, 2009 - 07:21

Actually i can translate vocab names there, but the problem is the translation does not appear in view and i still see the original name

#5

arhak - November 27, 2009 - 20:28

does this has something to do with #64004: Integration of i18n and views.module = fix translatablity of views?

from i18n's handbook page:

This is an ongoing work and it is a known fact that i18n's views support is far from complete so better than posting (yet another, duplicate) "I want better Views integration" feature request, you can comment on the existing one, #64004: Integration of i18n and views.module = fix translatablity of views Patches are welcomed though.

#6

arhak - November 27, 2009 - 20:30

@#5 nevertheless that issue was closed stating:

The original issue is fixed. Easier to pursue new ones in separate issues.

so probably this should be an ongoing issue by itself

#7

sinasalek - December 4, 2009 - 19:58

Thanks for participating @arhak,
No , i don't think it's related to that issue, this one is only about vocabulary names in node display. I tested it on a fresh drupal installation and translated vocabulary names but didn't see any change node's display.
I couldn't locate the code responsible to displaying vocab names simply by reviewing the source code , perhaps i need to check it more closely.

#8

arhak - December 4, 2009 - 22:26

reviewing the code (didn't debug it)

--> i18ntaxonomy_form_alter (default case)
--> i18ntaxonomy_node_form ( if ($vid == 'tags') {...} elseif (is_numeric($vid) && i18ntaxonomy_vocabulary($vid) == I18N_TAXONOMY_LOCALIZE) {...} )
--> i18ntaxonomy_vocabulary_form (return _i18ntaxonomy_term_select(check_plain(tt("taxonomy:vocabulary:$vid:name", $vocabulary->name)), ...);)

#9

arhak - December 4, 2009 - 22:28

@#8 now, that seems to be only for <select> widget

when it is free tagging I don't see vocabulary name translated

<?php
function i18ntaxonomy_node_form(&$form) {
  ...
    if (
$vid == 'tags') {
     
// Special treatment for tags, add some help texts
     
foreach (element_children($form['taxonomy']['tags']) as $vid) {
        if (
i18ntaxonomy_vocabulary($vid) == I18N_TAXONOMY_LOCALIZE) {
         
$form['taxonomy']['tags'][$vid]['#description'] .= ' '. t('This is a localizable vocabulary, so only terms in %language are allowed here.', array('%language' => language_default('name')));
        }
      }
    }
  ...
?>

am I missing something?

#10

jeyro - December 6, 2009 - 07:52

I assume this also depends on which translation option is used:

- none
- localise (I18N_TAXONOMY_LOCALIZE) - localizable vocabulary
- per language (I18N_TAXONOMY_TRANSLATE) - fully multilingual vocabulary
- set "language to vocabulary" (I18N_TAXONOMY_LANGUAGE) - fixed language vocabulary

For option "set language to vocabulary" the translation issue might not be relevant, strictly speaking, as there is no coordinated translation - just different language taxonomy sets, switching according to assigned languages. For option "localise", I can't really say, since I'm not localising.

Option "per language" should be fully multilingual (I'm using this one). In order to be able to assign the different language terms' translations to each other, the vocabulary language should _not_ be defined (at least, this is how I understand it). For this setting, the string translations made for vocabulary name and help text do not appear in create/view/edit pages when the language is switched. This for both standard (page/story) and contrib module content.

Shouldn't the code relate in one or another way to...

taxonomy:vocabulary:$vid:name
taxonomy:vocabulary:$vid:help

There are some instances in i18ntaxonomy.module. But this is as far as I get on my own (I don't know how to code php).

By the way, others are experiencing this issue as well: [#313268] (first three comments Feb-April 2009 [not resolved]).

#11

sinasalek - December 6, 2009 - 09:49

@jeyro
i18n taxonomy synchronization was quite incomplete few month ago, i opened #605600: Taxonomy syncronization issues in October to address all this issues, fortunately Jose was also interested and he fixed the issues by re-factoring the code. It's looks fine to me now, the only issue remains as long as i know is vocabulary names' translation.

@arhak
I think that code is for fixing vocab translation in node edit , not node view. And you're right it's not complete, The patch proposed here #494576: Translate tags vocablary name on node form? had a bug that i mentioned here http://drupal.org/node/494576#comment-2245840 and fixed here http://drupal.org/node/494576#comment-2254962, but it appears that the latest patch is not committed, so thanks for mentioning it i set that issue back to needs review.
Correcting my own comment #7, i think it might be related to #64004: Integration of i18n and views.module = fix translatablity of views , going to try the patches there and see if they fix this issues.
Thanks @arhak

#12

trupal218 - December 8, 2009 - 07:23

subscribing

#13

heyyo - December 8, 2009 - 07:27

subscribing

#14

adrianmak - February 26, 2010 - 04:43

subscribing...

#15

maijs - March 12, 2010 - 13:55

Guys, please test this with i18ntaxonomy 1.2.

Basically code in this patch translates the vocabulary name and help string if translation mode is set to "Per language term".

If you want to apply this to 1.3, change tt() function to i18nstrings() as code in 1.3 was refactored.

AttachmentSize
638556-15-i18ntaxonomy.module.patch 898 bytes

#16

adrianmak - March 12, 2010 - 13:47

who can talk about different use case of different mode of taxonomy translation ?

I found that, per language terms mode, the translation term will have different term id.
Is there any SEO issue ?

 
 

Drupal is a registered trademark of Dries Buytaert.