/**
* Get language codes that are detectable by our language detection routines.
- * Öanguages are excluded that aren't used often and that tend to false detections.
+ * Languages are excluded that aren't used often and that tend to false detections.
* The listed codes are a collection of both the official ISO 639-1 codes and
* the codes that are used by our built-in language detection routine.
* When the detection is done, the result only consists of the official ISO 639-1 codes.
{
$additional_langs = [
'af', 'az', 'az-Cyrl', 'az-Latn', 'be', 'bn', 'bs', 'bs-Cyrl', 'bs-Latn',
- 'cy', 'da', 'el', 'el-monoton', 'el-polyton', 'en', 'eu',
- 'fa', 'fi', 'ga', 'gl', 'he', 'hi', 'hr', 'hy', 'id', 'in', 'iw', 'jv', 'jw',
- 'ka', 'ko', 'lt', 'lv', 'mo', 'ms', 'ms-Arab', 'ms-Latn', 'nb', 'nn', 'no',
+ 'cy', 'da', 'el', 'el-monoton', 'el-polyton', 'en', 'eu', 'fa', 'fi',
+ 'ga', 'gl', 'gu', 'he', 'hi', 'hr', 'hy', 'id', 'in', 'iu', 'iw', 'jv', 'jw',
+ 'ka', 'km', 'ko', 'lt', 'lv', 'mo', 'ms', 'ms-Arab', 'ms-Latn', 'nb', 'nn', 'no',
'pt', 'pt-PT', 'pt-BR', 'ro', 'sa', 'sk', 'sl', 'sq', 'sr', 'sr-Cyrl', 'sr-Latn', 'sw',
'ta', 'th', 'tl', 'tr', 'ug', 'uk', 'uz', 'vi', 'zh', 'zh-Hant', 'zh-Hans',
];
if (in_array('cld2', get_loaded_extensions())) {
$additional_langs = array_merge($additional_langs,
- ['sd', 'si', 'yi', 'km', 'iu', 'lo', 'dv', 'gu', 'kn', 'te', 'ml', 'or', 'pa', 'iu']);
+ ['dv', 'kn', 'lo', 'ml', 'or', 'pa', 'sd', 'si', 'te', 'yi']);
}
$langs = array_merge($additional_langs, array_keys($this->getAvailableLanguages()));
}
/**
- * Return a list of supported languages witzh their two byte language codes.
+ * Return a list of supported languages with their two byte language codes.
*
* @param bool $international If set to true, additionally the international language name is returned as well.
* @return array
$code = $this->toISO6391($code);
$native = $iso639->nativeByCode1($code);
$language = $iso639->languageByCode1($code);
- if ($native != $iso639->languageByCode1($code) && $international) {
+ if ($native != $language && $international) {
$languages[$code] = $this->t('%s (%s)', $native, $language);
} else {
$languages[$code] = $native;