You are here

function translation_term_tid in Internationalization 5

Same name and namespace in other branches
  1. 5.3 translation/translation.module \translation_term_tid()
  2. 5.2 translation/translation.module \translation_term_tid()

Get translated term's tid

Parameters

$tid: Node nid to search for translation

$language: Language to search for the translation, defaults to current language

$default: Value that will be returned if no translation is found

Return value

Translated term tid if exists, or $default

1 call to translation_term_tid()
translation_taxonomy_tids in translation/translation.module
Returns an url for the translated taxonomy-page, if exists

File

translation/translation.module, line 1123

Code

function translation_term_tid($tid, $language = NULL, $default = NULL) {
  $translation = db_result(db_query("SELECT t.tid FROM {term_data} t INNER JOIN {term_data} a ON t.trid = a.trid AND t.tid != a.tid WHERE a.tid = %d AND t.language = '%s' AND t.trid", $tid, $language ? $language : i18n_get_lang()));
  return $translation ? $translation : $default;
}