From Piotr, a GSOC student for us, who needs a way to get unfiltered language list
This commit is contained in:
@@ -155,6 +155,99 @@ function PMA_langDetect(&$str, $envType)
|
||||
return false;
|
||||
} // end of the 'PMA_langDetect()' function
|
||||
|
||||
/**
|
||||
* Returns list of languages supported by phpMyAdmin
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function PMA_langList()
|
||||
{
|
||||
/**
|
||||
* All the supported languages have to be listed in the array below.
|
||||
* 1. The key must be the "official" ISO 639 language code and, if required,
|
||||
* the dialect code. It can also contain some informations about the
|
||||
* charset (see the Russian case).
|
||||
* 2. The first of the values associated to the key is used in a regular
|
||||
* expression to find some keywords corresponding to the language inside two
|
||||
* environment variables.
|
||||
* These values contains:
|
||||
* - the "official" ISO language code and, if required, the dialect code
|
||||
* also ('bu' for Bulgarian, 'fr([-_][[:alpha:]]{2})?' for all French
|
||||
* dialects, 'zh[-_]tw' for Chinese traditional...), the dialect has to
|
||||
* be specified as first;
|
||||
* - the '|' character (it means 'OR');
|
||||
* - the full language name.
|
||||
* 3. The second values associated to the key is the name of the file to load
|
||||
* without the 'inc.php' extension.
|
||||
* 4. The third values associated to the key is the language code as defined by
|
||||
* the RFC1766.
|
||||
* 5. The fourth value is native name in html entities.
|
||||
*
|
||||
* Beware that the sorting order (first values associated to keys by
|
||||
* alphabetical reverse order in the array) is important: 'zh-tw' (chinese
|
||||
* traditional) must be detected before 'zh' (chinese simplified) for
|
||||
* example.
|
||||
*
|
||||
*/
|
||||
return array(
|
||||
'af-utf-8' => array('af|afrikaans', 'afrikaans-utf-8', 'af', ''),
|
||||
'ar-utf-8' => array('ar|arabic', 'arabic-utf-8', 'ar', 'العربية'),
|
||||
'az-utf-8' => array('az|azerbaijani', 'azerbaijani-utf-8', 'az', 'Azərbaycanca'),
|
||||
'bn-utf-8' => array('bn|bangla', 'bangla-utf-8', 'bn', ''),
|
||||
'becyr-utf-8' => array('be|belarusian', 'belarusian_cyrillic-utf-8', 'be', 'Беларуская'),
|
||||
'belat-utf-8' => array('be[-_]lat|belarusian latin', 'belarusian_latin-utf-8', 'be-lat', 'Byelorussian'),
|
||||
'bg-utf-8' => array('bg|bulgarian', 'bulgarian-utf-8', 'bg', 'Български'),
|
||||
'bs-utf-8' => array('bs|bosnian', 'bosnian-utf-8', 'bs', 'Bosanski'),
|
||||
'ca-utf-8' => array('ca|catalan', 'catalan-utf-8', 'ca', 'Català'),
|
||||
'cs-utf-8' => array('cs|czech', 'czech-utf-8', 'cs', 'Česky'),
|
||||
'da-utf-8' => array('da|danish', 'danish-utf-8', 'da', 'Dansk'),
|
||||
'de-utf-8' => array('de|german', 'german-utf-8', 'de', 'Deutsch'),
|
||||
'el-utf-8' => array('el|greek', 'greek-utf-8', 'el', 'Ελληνικά'),
|
||||
'en-utf-8' => array('en|english', 'english-utf-8', 'en', ''),
|
||||
'es-utf-8' => array('es|spanish', 'spanish-utf-8', 'es', 'Español'),
|
||||
'et-utf-8' => array('et|estonian', 'estonian-utf-8', 'et', 'Eesti'),
|
||||
'eu-utf-8' => array('eu|basque', 'basque-utf-8', 'eu', 'Euskara'),
|
||||
'fa-utf-8' => array('fa|persian', 'persian-utf-8', 'fa', 'فارسی'),
|
||||
'fi-utf-8' => array('fi|finnish', 'finnish-utf-8', 'fi', 'Suomi'),
|
||||
'fr-utf-8' => array('fr|french', 'french-utf-8', 'fr', 'Français'),
|
||||
'gl-utf-8' => array('gl|galician', 'galician-utf-8', 'gl', 'Galego'),
|
||||
'he-utf-8' => array('he|hebrew', 'hebrew-utf-8', 'he', 'עברית'),
|
||||
'hi-utf-8' => array('hi|hindi', 'hindi-utf-8', 'hi', 'हिन्दी'),
|
||||
'hr-utf-8' => array('hr|croatian', 'croatian-utf-8', 'hr', 'Hrvatski'),
|
||||
'hu-utf-8' => array('hu|hungarian', 'hungarian-utf-8', 'hu', 'Magyar'),
|
||||
'id-utf-8' => array('id|indonesian', 'indonesian-utf-8', 'id', 'Bahasa Indonesia'),
|
||||
'it-utf-8' => array('it|italian', 'italian-utf-8', 'it', 'Italiano'),
|
||||
'ja-utf-8' => array('ja|japanese', 'japanese-utf-8', 'ja', '日本語'),
|
||||
'ko-utf-8' => array('ko|korean', 'korean-utf-8', 'ko', '한국어'),
|
||||
'ka-utf-8' => array('ka|georgian', 'georgian-utf-8', 'ka', 'ქართული'),
|
||||
'lt-utf-8' => array('lt|lithuanian', 'lithuanian-utf-8', 'lt', 'Lietuvių'),
|
||||
'lv-utf-8' => array('lv|latvian', 'latvian-utf-8', 'lv', 'Latviešu'),
|
||||
'mkcyr-utf-8' => array('mk|macedonian', 'macedonian_cyrillic-utf-8', 'mk', 'Macedonian'),
|
||||
'mn-utf-8' => array('mn|mongolian', 'mongolian-utf-8', 'mn', 'Монгол'),
|
||||
'ms-utf-8' => array('ms|malay', 'malay-utf-8', 'ms', 'Bahasa Melayu'),
|
||||
'nl-utf-8' => array('nl|dutch', 'dutch-utf-8', 'nl', 'Nederlands'),
|
||||
'no-utf-8' => array('no|norwegian', 'norwegian-utf-8', 'no', 'Norsk'),
|
||||
'pl-utf-8' => array('pl|polish', 'polish-utf-8', 'pl', 'Polski'),
|
||||
'ptbr-utf-8' => array('pt[-_]br|brazilian portuguese', 'brazilian_portuguese-utf-8', 'pt-BR', 'Português'),
|
||||
'pt-utf-8' => array('pt|portuguese', 'portuguese-utf-8', 'pt', 'Português'),
|
||||
'ro-utf-8' => array('ro|romanian', 'romanian-utf-8', 'ro', 'Română'),
|
||||
'ru-utf-8' => array('ru|russian', 'russian-utf-8', 'ru', 'Русский'),
|
||||
'si-utf-8' => array('si|sinhala', 'sinhala-utf-8', 'si', 'සිංහල'),
|
||||
'sk-utf-8' => array('sk|slovak', 'slovak-utf-8', 'sk', 'Slovenčina'),
|
||||
'sl-utf-8' => array('sl|slovenian', 'slovenian-utf-8', 'sl', 'Slovenščina'),
|
||||
'sq-utf-8' => array('sq|albanian', 'albanian-utf-8', 'sq', 'Shqip'),
|
||||
'srlat-utf-8' => array('sr[-_]lat|serbian latin', 'serbian_latin-utf-8', 'sr-lat', 'Srpski'),
|
||||
'srcyr-utf-8' => array('sr|serbian', 'serbian_cyrillic-utf-8', 'sr', 'Српски'),
|
||||
'sv-utf-8' => array('sv|swedish', 'swedish-utf-8', 'sv', 'Svenska'),
|
||||
'th-utf-8' => array('th|thai', 'thai-utf-8', 'th', 'ภาษาไทย'),
|
||||
'tr-utf-8' => array('tr|turkish', 'turkish-utf-8', 'tr', 'Türkçe'),
|
||||
'tt-utf-8' => array('tt|tatarish', 'tatarish-utf-8', 'tt', 'Tatarça'),
|
||||
'uk-utf-8' => array('uk|ukrainian', 'ukrainian-utf-8', 'uk', 'Українська'),
|
||||
'zhtw-utf-8' => array('zh[-_](tw|hk)|chinese traditional', 'chinese_traditional-utf-8', 'zh-TW', '中文'),
|
||||
'zh-utf-8' => array('zh|chinese simplified', 'chinese_simplified-utf-8', 'zh', '中文'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @global string path to the translations directory
|
||||
*/
|
||||
@@ -181,93 +274,10 @@ $GLOBALS['lang_failed_request'] = false;
|
||||
*/
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
|
||||
/**
|
||||
* All the supported languages have to be listed in the array below.
|
||||
* 1. The key must be the "official" ISO 639 language code and, if required,
|
||||
* the dialect code. It can also contain some informations about the
|
||||
* charset (see the Russian case).
|
||||
* 2. The first of the values associated to the key is used in a regular
|
||||
* expression to find some keywords corresponding to the language inside two
|
||||
* environment variables.
|
||||
* These values contains:
|
||||
* - the "official" ISO language code and, if required, the dialect code
|
||||
* also ('bu' for Bulgarian, 'fr([-_][[:alpha:]]{2})?' for all French
|
||||
* dialects, 'zh[-_]tw' for Chinese traditional...), the dialect has to
|
||||
* be specified as first;
|
||||
* - the '|' character (it means 'OR');
|
||||
* - the full language name.
|
||||
* 3. The second values associated to the key is the name of the file to load
|
||||
* without the 'inc.php' extension.
|
||||
* 4. The third values associated to the key is the language code as defined by
|
||||
* the RFC1766.
|
||||
* 5. The fourth value is native name in html entities.
|
||||
*
|
||||
* Beware that the sorting order (first values associated to keys by
|
||||
* alphabetical reverse order in the array) is important: 'zh-tw' (chinese
|
||||
* traditional) must be detected before 'zh' (chinese simplified) for
|
||||
* example.
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @global array supported languages
|
||||
*/
|
||||
$GLOBALS['available_languages'] = array(
|
||||
'af-utf-8' => array('af|afrikaans', 'afrikaans-utf-8', 'af', ''),
|
||||
'ar-utf-8' => array('ar|arabic', 'arabic-utf-8', 'ar', 'العربية'),
|
||||
'az-utf-8' => array('az|azerbaijani', 'azerbaijani-utf-8', 'az', 'Azərbaycanca'),
|
||||
'bn-utf-8' => array('bn|bangla', 'bangla-utf-8', 'bn', ''),
|
||||
'becyr-utf-8' => array('be|belarusian', 'belarusian_cyrillic-utf-8', 'be', 'Беларуская'),
|
||||
'belat-utf-8' => array('be[-_]lat|belarusian latin', 'belarusian_latin-utf-8', 'be-lat', 'Byelorussian'),
|
||||
'bg-utf-8' => array('bg|bulgarian', 'bulgarian-utf-8', 'bg', 'Български'),
|
||||
'bs-utf-8' => array('bs|bosnian', 'bosnian-utf-8', 'bs', 'Bosanski'),
|
||||
'ca-utf-8' => array('ca|catalan', 'catalan-utf-8', 'ca', 'Català'),
|
||||
'cs-utf-8' => array('cs|czech', 'czech-utf-8', 'cs', 'Česky'),
|
||||
'da-utf-8' => array('da|danish', 'danish-utf-8', 'da', 'Dansk'),
|
||||
'de-utf-8' => array('de|german', 'german-utf-8', 'de', 'Deutsch'),
|
||||
'el-utf-8' => array('el|greek', 'greek-utf-8', 'el', 'Ελληνικά'),
|
||||
'en-utf-8' => array('en|english', 'english-utf-8', 'en', ''),
|
||||
'es-utf-8' => array('es|spanish', 'spanish-utf-8', 'es', 'Español'),
|
||||
'et-utf-8' => array('et|estonian', 'estonian-utf-8', 'et', 'Eesti'),
|
||||
'eu-utf-8' => array('eu|basque', 'basque-utf-8', 'eu', 'Euskara'),
|
||||
'fa-utf-8' => array('fa|persian', 'persian-utf-8', 'fa', 'فارسی'),
|
||||
'fi-utf-8' => array('fi|finnish', 'finnish-utf-8', 'fi', 'Suomi'),
|
||||
'fr-utf-8' => array('fr|french', 'french-utf-8', 'fr', 'Français'),
|
||||
'gl-utf-8' => array('gl|galician', 'galician-utf-8', 'gl', 'Galego'),
|
||||
'he-utf-8' => array('he|hebrew', 'hebrew-utf-8', 'he', 'עברית'),
|
||||
'hi-utf-8' => array('hi|hindi', 'hindi-utf-8', 'hi', 'हिन्दी'),
|
||||
'hr-utf-8' => array('hr|croatian', 'croatian-utf-8', 'hr', 'Hrvatski'),
|
||||
'hu-utf-8' => array('hu|hungarian', 'hungarian-utf-8', 'hu', 'Magyar'),
|
||||
'id-utf-8' => array('id|indonesian', 'indonesian-utf-8', 'id', 'Bahasa Indonesia'),
|
||||
'it-utf-8' => array('it|italian', 'italian-utf-8', 'it', 'Italiano'),
|
||||
'ja-utf-8' => array('ja|japanese', 'japanese-utf-8', 'ja', '日本語'),
|
||||
'ko-utf-8' => array('ko|korean', 'korean-utf-8', 'ko', '한국어'),
|
||||
'ka-utf-8' => array('ka|georgian', 'georgian-utf-8', 'ka', 'ქართული'),
|
||||
'lt-utf-8' => array('lt|lithuanian', 'lithuanian-utf-8', 'lt', 'Lietuvių'),
|
||||
'lv-utf-8' => array('lv|latvian', 'latvian-utf-8', 'lv', 'Latviešu'),
|
||||
'mkcyr-utf-8' => array('mk|macedonian', 'macedonian_cyrillic-utf-8', 'mk', 'Macedonian'),
|
||||
'mn-utf-8' => array('mn|mongolian', 'mongolian-utf-8', 'mn', 'Монгол'),
|
||||
'ms-utf-8' => array('ms|malay', 'malay-utf-8', 'ms', 'Bahasa Melayu'),
|
||||
'nl-utf-8' => array('nl|dutch', 'dutch-utf-8', 'nl', 'Nederlands'),
|
||||
'no-utf-8' => array('no|norwegian', 'norwegian-utf-8', 'no', 'Norsk'),
|
||||
'pl-utf-8' => array('pl|polish', 'polish-utf-8', 'pl', 'Polski'),
|
||||
'ptbr-utf-8' => array('pt[-_]br|brazilian portuguese', 'brazilian_portuguese-utf-8', 'pt-BR', 'Português'),
|
||||
'pt-utf-8' => array('pt|portuguese', 'portuguese-utf-8', 'pt', 'Português'),
|
||||
'ro-utf-8' => array('ro|romanian', 'romanian-utf-8', 'ro', 'Română'),
|
||||
'ru-utf-8' => array('ru|russian', 'russian-utf-8', 'ru', 'Русский'),
|
||||
'si-utf-8' => array('si|sinhala', 'sinhala-utf-8', 'si', 'සිංහල'),
|
||||
'sk-utf-8' => array('sk|slovak', 'slovak-utf-8', 'sk', 'Slovenčina'),
|
||||
'sl-utf-8' => array('sl|slovenian', 'slovenian-utf-8', 'sl', 'Slovenščina'),
|
||||
'sq-utf-8' => array('sq|albanian', 'albanian-utf-8', 'sq', 'Shqip'),
|
||||
'srlat-utf-8' => array('sr[-_]lat|serbian latin', 'serbian_latin-utf-8', 'sr-lat', 'Srpski'),
|
||||
'srcyr-utf-8' => array('sr|serbian', 'serbian_cyrillic-utf-8', 'sr', 'Српски'),
|
||||
'sv-utf-8' => array('sv|swedish', 'swedish-utf-8', 'sv', 'Svenska'),
|
||||
'th-utf-8' => array('th|thai', 'thai-utf-8', 'th', 'ภาษาไทย'),
|
||||
'tr-utf-8' => array('tr|turkish', 'turkish-utf-8', 'tr', 'Türkçe'),
|
||||
'tt-utf-8' => array('tt|tatarish', 'tatarish-utf-8', 'tt', 'Tatarça'),
|
||||
'uk-utf-8' => array('uk|ukrainian', 'ukrainian-utf-8', 'uk', 'Українська'),
|
||||
'zhtw-utf-8' => array('zh[-_](tw|hk)|chinese traditional', 'chinese_traditional-utf-8', 'zh-TW', '中文'),
|
||||
'zh-utf-8' => array('zh|chinese simplified', 'chinese_simplified-utf-8', 'zh', '中文'),
|
||||
);
|
||||
$GLOBALS['available_languages'] = PMA_langList();
|
||||
|
||||
// Language filtering support
|
||||
if (! empty($GLOBALS['cfg']['FilterLanguages'])) {
|
||||
|
Reference in New Issue
Block a user