You are here

function _i18n_string_locale_translate_language_list in Internationalization 7

List languages in search result table.

1 call to _i18n_string_locale_translate_language_list()
_i18n_string_locale_translate_seek in i18n_string/i18n_string.pages.inc
Perform a string search and display results in a table

File

i18n_string/i18n_string.pages.inc, line 582
Internationalization (i18n) package - translatable strings reusable admin UI.

Code

function _i18n_string_locale_translate_language_list($string, $limit_language) {

  // Add CSS.
  drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css');

  // Include both translated and not yet translated target languages in the
  // list. The source language is English for built-in strings and the default
  // language for other strings.
  $languages = language_list();
  $default = language_default();
  $omit = $string['group'] == 'default' ? 'en' : variable_get('i18n_string_source_language', $default->language);
  unset($languages[$omit]);
  $output = '';
  foreach ($languages as $langcode => $language) {
    if (!$limit_language || $limit_language == $langcode) {
      $output .= !empty($string['languages'][$langcode]) ? $langcode . ' ' : "<em class=\"locale-untranslated\">{$langcode}</em> ";
    }
  }
  return $output;
}