atr_languages

Versions
6.1
atr_languages()

Return a list of languages.

Return value

Array where the keys are languages codes and values are language names.

▾ 3 functions call atr_languages()

atr_form_review in atr/includes/atr.admin.inc
Form builder; manually configure and start a text review.
atr_language in atr/includes/atr.admin.inc
Return a language name based on a language code.
atr_languages_profile in atr/includes/atr.admin.inc
Return a list of languages.

Code

atr/includes/atr.admin.inc, line 357

<?php
function atr_languages() {
  static $languages = NULL;
  include_once './includes/locale.inc';

  if(!$languages) {
    $languages = _locale_get_predefined_list();
    foreach ($languages as $code => $names) {
      // Include native name in output, if possible
      $name = t($names[0]);
      $languages[$code] = $name;
      if (count($names) > 1 && $name != $names[1]) {
        $languages[$code] .= ' (' . $names[1] . ')';
      }
    }
    asort($languages);
  }

  return $languages;
}
?>