You are here

function i18nstrings_translate_langcode in Internationalization 6

Check if translation is required for this language code.

Translation is required when default language is different from the given language, or when default language translation is explicitly enabled.

No UI is provided to enable translation of default language. On the other hand, you can enable/disable translation for a specific language by adding the following to your settings.php

// Enable translation of specific language. Language code is 'xx'
$conf['i18nstrings_translate_langcode_xx'] = TRUE;

// Disable translation of specific language. Language code is 'yy'
$conf['i18nstrings_translate_langcode_yy'] = FALSE;
3 calls to i18nstrings_translate_langcode()
i18nstrings in i18nstrings/i18nstrings.module
Translate user defined string.
i18nstrings_text in i18nstrings/i18nstrings.module
Get filtered translation.
i18nstrings_translate_object in i18nstrings/i18nstrings.module
Translate object properties.

File

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

Code

function i18nstrings_translate_langcode($langcode) {
  static $translate = array();
  if (!isset($translate[$langcode])) {
    $translate[$langcode] = variable_get('i18nstrings_translate_langcode_' . $langcode, language_default('language') != $langcode);
  }
  return $translate[$langcode];
}