You are here

function _locale_translate_language_list in Drupal 7

Same name and namespace in other branches
  1. 6 includes/locale.inc \_locale_translate_language_list()

List languages in search result table

Related topics

1 call to _locale_translate_language_list()
_locale_translate_seek in includes/locale.inc
Perform a string search and display results in a table

File

includes/locale.inc, line 2168
Administration functions for locale.module.

Code

function _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' : $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;
}