You are here

function i18nstrings_string in Internationalization 6

Translation for plain string. In case it finds a translation it applies check_plain() to it

Parameters

$name: Full string id

$default: Default string to return if not found

$langcode: Optional language code if different from current request language.

$filter_default: Whether to filter (check_plain) the default too if it is retrieved

4 calls to i18nstrings_string()
i18nblocks_preprocess_block in i18nblocks/i18nblocks.module
Implementation of hook_preprocess_block().
i18nblocks_translate_block in i18nblocks/i18nblocks.module
Translate block.
i18ntaxonomy_translate_term_name in i18ntaxonomy/i18ntaxonomy.module
Translate term name
i18ntaxonomy_translate_vocabulary_name in i18ntaxonomy/i18ntaxonomy.module
Translate vocabulary name

File

i18nstrings/i18nstrings.module, line 1163
Internationalization (i18n) package - translatable strings.

Code

function i18nstrings_string($name, $default, $langcode = NULL, $filter_default = FALSE) {
  $translation = i18nstrings($name, NULL, $langcode);
  if (isset($translation)) {
    return check_plain($translation);
  }
  else {
    return $filter_default ? check_plain($default) : $default;
  }
}