0

I want to localise vocabulary fields especially description field. Does it exist some function like i18n_taxonomy_localize_terms( taxonomy_term_load($tid) for taxonomy_vocabulary_load($vid). Or maybe some different method.

Thanks

2
  • Did you try the taxonomy translation module in i18n module? I think that will do the job!
    – Gladiator
    Commented Oct 29, 2013 at 12:47
  • yes i translated e.g. vocabulary description via that module but how to invoke on other languages
    – Nikola
    Commented Oct 29, 2013 at 14:46

2 Answers 2

1

You can localize the taxonomy description field out-of-the-box with the Entity Translation module. While Entity Translation can be used in combination with the i18n suite of modules, note that you cannot use Entity Translation for taxonomy in conjunction with the i18n Taxonomy translation module; you must select one or the other.

If you use Entity Translation, to translate the taxonomy term names you will also need the Title module.

2
  • So i have to install module just for one sentence :/ rather i will make some sql query or something
    – Nikola
    Commented Oct 29, 2013 at 14:34
  • @Nikola I just saw your comment that you already translated the strings using i18n taxonomy. I will leave my answer for people wanting to do this from scratch, but in your specific case you simply need to add support for i18n to the module that is not displaying the strings properly. Commented Oct 30, 2013 at 1:27
1

I made simple function. I don't know is it properly but it do job for me. Where $lid Unique identifier of this string, you can find it on page Configuration » Regional and language » Translate interface, edit link.

function t_lid($lid,$lang){    
    $translation=db_query('SELECT l.translation FROM {locales_target} l WHERE l.lid = :lid AND l.language=:lang', array(':lid' => $lid,':lang'=>$lang))->fetchField();
        return $translation;
    }

I hate to install module for one simple thing :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.