You are here

function tt in Internationalization 5

Same name and namespace in other branches
  1. 5.3 i18n.module \tt()
  2. 5.2 experimental/i18nstrings.module \tt()
  3. 6 i18nstrings/i18nstrings.module \tt()

Translate configurable string

2 calls to tt()
i18ncontent_node_info in experimental/i18ncontent.module
Returns node types with translated info
i18nstrings_admin_overview in experimental/i18nstrings.module
List of strings

File

experimental/i18nstrings.module, line 134
Internationalization (i18n) package - translattable strings

Code

function tt($strid, $default = NULL, $language = NULL) {
  $language = $language ? $language : i18n_get_lang();
  if ($translation = i18nstrings_get_string($strid, $language)) {
    return $translation;
  }
  elseif ($default) {
    i18nstrings_save_string($strid, $language, $default);
    return $default;
  }
  elseif ($language != i18n_default_language() && ($translation = i18nstrings_get_string($strid, i18n_default_language()))) {
    return $translation;
  }
}