language-list
language-list copied to clipboard
request: include native list
a "native" list with each language in its native language and script would be useful
e.g.
ru русский
sa संस्कृतम्
en English
Any reason my message from yesterday got removed?
I came up with this:
/**
* Let's get the language code + English name + Endonym (the language's name in
* the language) for ALL locales supported by PHP.
*/
$languages = ResourceBundle::getLocales('');
header("Content-Type: text/plain");
echo "CODE\tLANGUAGE_NAME\tENDONYM\n";
foreach($languages as $language) {
echo
$language
. "\t"
. ucfirst(Locale::getDisplayName($language, 'en-US'))
. "\t"
. mb_convert_case(
Locale::getDisplayName($language, $language),
MB_CASE_TITLE,
'UTF-8'
)
. "\n";
}
It will return:
CODE LANGUAGE_NAME ENDONYM
af Afrikaans Afrikaans
af_NA Afrikaans (Namibia) Afrikaans (Namibië)
af_ZA Afrikaans (South Africa) Afrikaans (Suid-Afrika)
agq Aghem Aghem
agq_CM Aghem (Cameroon) Aghem (Kàmàlûŋ)
ak Akan Akan
ak_GH Akan (Ghana) Akan (Gaana)
am Amharic አማርኛ
am_ET Amharic (Ethiopia) አማርኛ (ኢትዮጵያ)
ar Arabic العربية
ar_001 Arabic (World) العربية (العالم)
ar_AE Arabic (United Arab Emirates) العربية (الإمارات العربية المتحدة)
...
thank you for the work around :}