function i18ntaxonomy_translate_term_name in Internationalization 6
Translate term name
Parameters
$tid: Term id or term object
$name: Filtered default(untranslated) name
2 calls to i18ntaxonomy_translate_term_name()
- i18ntaxonomy_form_all_localize in i18ntaxonomy/
i18ntaxonomy.module - Localize a taxonomy_form_all() kind of control
- i18ntaxonomy_term_page in i18ntaxonomy/
i18ntaxonomy.pages.inc - Menu callback; displays all nodes associated with a term.
File
- i18ntaxonomy/
i18ntaxonomy.module, line 196 - i18n taxonomy module
Code
function i18ntaxonomy_translate_term_name($tid, $name = '', $langcode = NULL) {
// If it is a term object we check for vocabulary options
if (is_object($tid)) {
return i18ntaxonomy_vocabulary($tid->vid) == I18N_TAXONOMY_LOCALIZE ? i18nstrings_string("taxonomy:term:{$tid->tid}:name", $tid->name, $langcode, TRUE) : check_plain($tid->name);
}
else {
return i18nstrings_string("taxonomy:term:{$tid}:name", $name, $langcode);
}
}