You are here

function i18n_string_translate_langcode in Internationalization 7

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['i18n_string_translate_langcode_xx'] = TRUE;

// Disable translation of specific language. Language code is 'yy'
$conf['i18n_string_translate_langcode_yy'] = FALSE;

Parameters

$langcode: Optional language code to check. It will default to current request language.

5 calls to i18n_string_translate_langcode()
i18n_string_object_translate in i18n_string/i18n_string.module
Translate object properties
i18n_string_translate in i18n_string/i18n_string.module
Get translation for user defined string.
i18n_string_translate_list in i18n_string/i18n_string.module
Translation for list of options
i18n_taxonomy_localize_terms in i18n_taxonomy/i18n_taxonomy.module
Localize taxonomy terms for localizable vocabularies.
i18n_taxonomy_views_pre_render in i18n_taxonomy/i18n_taxonomy.module
Implements hook_views_pre_render().

File

i18n_string/i18n_string.module, line 318
Internationalization (i18n) package - translatable strings.

Code

function i18n_string_translate_langcode($langcode = NULL) {
  $translate =& drupal_static(__FUNCTION__);
  $langcode = isset($langcode) ? $langcode : i18n_langcode();
  if (!isset($translate[$langcode])) {
    $translate[$langcode] = variable_get('i18n_string_translate_langcode_' . $langcode, i18n_string_source_language() != $langcode);
  }
  return $translate[$langcode];
}