You are here

function i18nstrings in Internationalization 6

Translate user defined string.

Parameters

$name: Textgroup and location glued with ':'.

$string: String in default language. Default language may or may not be English.

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

Return value

$string Translated string, $string if not found

27 calls to i18nstrings()
i18ncck_content_allowed_values_alter in i18ncck/i18ncck.module
Translate allowed values lists.
i18ncck_content_fieldgroup_strings_alter in i18ncck/i18ncck.module
Translate fieldgroup labels and descriptions.
i18ncck_content_field_strings_alter in i18ncck/i18ncck.module
Translate widget's labels and descriptions.
i18ncontent_form_alter in i18ncontent/i18ncontent.module
Implementation of hook_form_alter().
i18ncontent_help in i18ncontent/i18ncontent.module
Implementation of hook_help().

... See full list

13 string references to 'i18nstrings'
i18ncck_enable in i18ncck/i18ncck.install
Implementation of hook_enable().
i18ncontent_enable in i18ncontent/i18ncontent.install
Implementation of hook_enable().
i18ncontent_update_6002 in i18ncontent/i18ncontent.install
Locale refresh, this will run successfully only after the i18nstrings update has run
i18nmenu_enable in i18nmenu/i18nmenu.install
Implementation of hook_enable().
i18nprofile_enable in i18nprofile/i18nprofile.install
Refresh strings when enabled.

... See full list

File

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

Code

function i18nstrings($name, $string, $langcode = NULL) {
  global $language;
  $langcode = $langcode ? $langcode : $language->language;

  // If language is default, just return
  if (i18nstrings_translate_langcode($langcode)) {
    return i18nstrings_translate_string($name, $string, $langcode);
  }
  return $string;
}