You are here

function i18nstrings_ts in Internationalization 6

Get configurable string.

The difference with i18nstrings() is that it doesn't use a default string, it will be retrieved too.

This is used for source texts that we don't have stored anywhere else. I.e. for the content types help text (i18ncontent module) there's no way we can override the default (configurable) help text so what we do is to make it blank in the configuration (so node module doesn't display it) and then we provide that help text for *all* languages, out from the locales tables.

As the original language string will be stored in locales too so it should be only used when updating.

3 calls to i18nstrings_ts()
i18ncontent_disable in i18ncontent/i18ncontent.install
Implementation of hook_disable().
i18ncontent_locale_refresh in i18ncontent/i18ncontent.module
Refresh content type strings.
i18ncontent_node_type in i18ncontent/i18ncontent.module
Implementation of hook_node_type().

File

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

Code

function i18nstrings_ts($name, $string = '', $langcode = NULL, $update = FALSE) {
  global $language;
  $langcode = $langcode ? $langcode : $language->language;
  $translation = NULL;
  if ($update) {
    i18nstrings_update_string($name, $string);
  }
  $translation = i18nstrings_translate_string($name, $string, $langcode);
  return $translation;
}