Closed (fixed)
Project:
Internationalization
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Jul 2008 at 08:14 UTC
Updated:
17 Oct 2008 at 14:52 UTC
Hi
I'm using vocabulary with localized terms, i.e. terms and descriptions are commons to all languages and can be translated.
I want to build a block that shows all terms of that vocabulary, something like this:
<?php
$vid = 1; /* <---- put correct vocabulary ID here */
$terms = taxonomy_get_tree($vid);
print "<div class=\"item-list\"><ul>";
foreach ( $terms as $term ) {
print "<li>".
l($term->name,'taxonomy/term/'.$term->tid, array('title' => $term->name)).
"</li>";
} /* end foreach */
print "</ul></div>";
?>
The question is:
What function should I use to translate the terms?
Probably, the next line should include some i18n function to translate the name of the link:
l($term->name,'taxonomy/term/'.$term->tid, array('title' => $term->name)).
Thanks in advance.
Comments
Comment #1
jose reyero commentedGive a try and/or see the code in i18ntaxonomy (Multilingual Taxonomy) module
Comment #2
jose reyero commentedIt will depend on your vocabulary options.
For localizable ones, it should be:
Comment #3
phKU commentedThanks Jose, function tt() works fine for me :)
Comment #4
fjuan commentedThank you very much
It works great whithin that code:
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.