Mit Zend_Locale::getTranslationList('Language') kann man sich im Zend-Framework eine Liste aller bekannten Sprachen erstellen lassen. Will man diese auch gleich noch in eine Datenbank eintragen, kann man sich mit meinem kleinen Script einen SQL-Query zusammenbauen. Das Script geht alle Sprachen durch und prüft, ob eine bekannte Übersetzung in der Muttersprache vorliegt, ansonsten wählt es den englischen Namen.

<?php
$languages = Zend_Locale::getTranslationList('Language');
foreach (array_keys($languages) as $short) {
    try {
        $name = Zend_Locale::getTranslation($short, 'Language', $short);
        if (empty($name)) {
            throw new Exception();
        }
    } catch (Exception $e) {
        $name = Zend_Locale::getTranslation($short, 'Language', 'en');
    }
    echo sprintf("%-10s",   $short. ",") . $name . "\n";
}

Mit wenigen Änderungen kann man dies für seine eigene Tabelle zu einem SQL-Query anpassen. Wer sich diesen Aufwand nicht machen will, kann auch meinen vorgefertigten SQL-Query für die Zend-Sprachtabelle verwenden (auf Kodierung des Browsers achten).

Die aktuelle Ausgabe für obigen Code ist:

aa,       Qafar
ab,       Abkhazian
ace,      Achinese
ach,      Acoli
ada,      Adangme
ady,      Adyghe
ae,       الأفستية
af,       Afrikaans
afa,      Afro-Asiatic Language
afh,      Afrihili
ain,      Ainu
ak,       Akan
akk,      Akkadian
ale,      Aleut
alg,      Algonquian Language
alt,      Southern Altai
am,       አማርኛ
an,       Aragonesisch
ang,      Old English
anp,      Angika
apa,      Apache Language
ar,       العربية
arc,      Aramaic
arn,      Araucanian
arp,      Arapaho
art,      Artificial Language
arw,      Arawak
as,       অসমীয়া
ast,      Asturian
ath,      Athapascan Language
aus,      Australian Language
av,       Avaric
awa,      Awadhi
ay,       Aymara
az,       azərbaycanca
ba,       Bashkir
bad,      Banda
bai,      Bamileke Language
bal,      Baluchi
ban,      Balinese
bas,      Basa
bat,      Baltic Language
be,       беларуская
bej,      Beja
bem,      Bemba
ber,      Berber
bg,       български
bh,       البيهارية
bho,      Bhojpuri
bi,       Bislama
bik,      Bikol
bin,      Bini
bla,      Siksika
bm,       Bambara
bn,       বাংলা
bnt,      Bantu
bo,       པོད་སྐད་
br,       bretão
bra,      Braj
bs,       bosanski
btk,      Batak
bua,      Buriat
bug,      Buginese
byn,      ብሊን
ca,       català
cad,      Caddo
cai,      Central American Indian Language
car,      Carib
cau,      Caucasian Language
cch,      Atsam
ce,       Chechen
ceb,      Cebuano
cel,      Celtic Language
ch,       Chamorro-Sprache
chb,      Chibcha
chg,      Chagatai
chk,      Chuukese
chm,      Mari
chn,      Chinook Jargon
cho,      Choctaw
chp,      Chipewyan
chr,      Cherokee
chy,      Cheyenne
cmc,      Chamic Language
co,       corso
cop,      Coptic
cpe,      English-based Creole or Pidgin
cpf,      French-based Creole or Pidgin
cpp,      Portuguese-based Creole or Pidgin
cr,       cree
crh,      Crimean Turkish
crp,      Creole or Pidgin
cs,       čeština
csb,      Kashubian
cu,       Church Slavic
cus,      Cushitic Language
cv,       Tschuwaschisch
cy,       Cymraeg
da,       dansk
dak,      Dakota
dar,      Dargwa
day,      Dayak
de,       Deutsch
de_AT,    Österreichisches Deutsch
de_CH,    Schweizer Hochdeutsch
del,      Delaware
den,      Slave
dgr,      Dogrib
din,      Dinka
doi,      Dogri
dra,      Dravidian Language
dsb,      Lower Sorbian
dua,      Duala
dum,      Middle Dutch
dv,       ދިވެހިބަސް
dyu,      Dyula
dz,       རྫོང་ཁ
ee,       Ewe
efi,      Efik
egy,      Ancient Egyptian
eka,      Ekajuk
el,       Ελληνικά
elx,      Elamite
en,       English
en_AU,    Australian English
en_CA,    Canadian English
en_GB,    British English
en_US,    U.S. English
enm,      Middle English
eo,       esperanto
es,       español
es_419,   español latinoamericano
es_ES,    español de España
et,       eesti
eu,       euskara
ewo,      Ewondo
fa,       فارسی
fan,      Fang
fat,      Fanti
ff,       Fulah
fi,       suomi
fil,      Filipino
fiu,      Finno-Ugrian Language
fj,       Fijian
fo,       føroyskt
fon,      Fon
fr,       français
fr_CA,    français canadien
fr_CH,    français suisse
frm,      Middle French
fro,      Old French
frr,      Northern Frisian
frs,      Eastern Frisian
fur,      furlan
fy,       Western Frisian
ga,       Gaeilge
gaa,      Ga
gay,      Gayo
gba,      Gbaya
gd,       Scottish Gaelic
gem,      Germanic Language
gez,      ግዕዝኛ
gil,      Gilbertese
gl,       galego
gmh,      Middle High German
gn,       Guarani
goh,      Old High German
gon,      Gondi
gor,      Gorontalo
got,      Gothic
grb,      Grebo
grc,      Ancient Greek
gsw,      Schwiizertüütsch
gu,       ગુજરાતી
gv,       Gaelg
gwi,      Gwichʼin
ha,       Haoussa
hai,      Haida
haw,      ʻōlelo Hawaiʻi
he,       עברית
hi,       हिन्दी
hil,      Hiligaynon
him,      Himachali
hit,      Hittite
hmn,      Hmong
ho,       Hiri Motu
hr,       hrvatski
hsb,      Upper Sorbian
ht,       Haitianisch
hu,       magyar
hup,      Hupa
hy,       Հայերէն
hz,       Herero
ia,       interlingua
iba,      Iban
id,       Bahasa Indonesia
ie,       Interlingue
ig,       Igbo
ii,       ꆈꌠꉙ
ijo,      Ijo
ik,       Inupiaq
ilo,      Iloko
inc,      Indic Language
ine,      Indo-European Language
inh,      Ingush
io,       Ido-Sprache
ira,      Iranian Language
iro,      Iroquoian Language
is,       íslenska
it,       italiano
iu,       ᐃᓄᒃᑎᑐᑦ ᑎᑎᕋᐅᓯᖅ
ja,       日本語
jbo,      Lojban
jpr,      Judeo-Persian
jrb,      Judeo-Arabic
jv,       Javanese
ka,       ქართული
kaa,      Kara-Kalpak
kab,      Kabyle
kac,      Kachin
kaj,      Jju
kam,      Kamba
kar,      Karen
kaw,      Kawi
kbd,      Kabardian
kcg,      Tyap
kfo,      Koro
kg,       Kongo
kha,      Khasi
khi,      Khoisan Language
kho,      Khotanese
ki,       Kikuyu
kj,       Kuanyama
kk,       Қазақ
kl,       kalaallisut
km,       ភាសាខ្មែរ
kmb,      Kimbundu
kn,       ಕನ್ನಡ
ko,       한국어
kok,      कोंकणी
kos,      Kosraean
kpe,      Kpelle
kr,       칸누리어
krc,      Karachay-Balkar
krl,      Karelian
kro,      Kru
kru,      Kurukh
ks,       Kashmiri
ku,       كوردی
kum,      Kumyk
kut,      Kutenai
kv,       Komi
kw,       kernewek
ky,       Кыргыз
la,       ລາແຕັງ
lad,      Ladino
lah,      Lahnda
lam,      Lamba
lb,       اللوكسمبرجية
lez,      Lezghian
lg,       Ganda
li,       Limburgisch
ln,       lingála
lo,       ລາວ
lol,      Mongo
loz,      Lozi
lt,       lietuvių
lu,       luba-katanga
lua,      Luba-Lulua
lui,      Luiseno
lun,      Lunda
luo,      Luo
lus,      Lushai
lv,       latviešu
mad,      Madurese
mag,      Magahi
mai,      Maithili
mak,      Makasar
man,      Mandingo
map,      Austronesian Language
mas,      Masai
mdf,      Moksha
mdr,      Mandar
men,      Mende
mg,       Malagassi-Sprache
mga,      Middle Irish
mh,       Marschallesisch
mi,       Maori
mic,      Micmac
min,      Minangkabau
mis,      Miscellaneous Language
mk,       македонски
mkh,      Mon-Khmer Language
ml,       മലയാളം
mn,       монгол
mnc,      Manchu
mni,      Manipuri
mno,      Manobo Language
mo,       moldovenească
moh,      Mohawk
mos,      Mossi
mr,       मराठी
ms,       Bahasa Melayu
mt,       Malti
mul,      Multiple Languages
mun,      Munda Language
mus,      Creek
mwl,      Mirandese
mwr,      Marwari
my,       ဗမာ
myn,      Mayan Language
myv,      Erzya
na,       Nauruisch
nah,      Nahuatl
nai,      North American Indian Language
nap,      Neapolitan
nb,       norsk bokmål
nd,       North Ndebele
nds,      Plattdüütsch
ne,       नेपाली
new,      Newari
ng,       Ndonga
nia,      Nias
nic,      Niger-Kordofanian Language
niu,      Niuean
nl,       Nederlands
nl_BE,    Vlaams
nn,       nynorsk
no,       norsk
nog,      Nogai
non,      Old Norse
nqo,      N’Ko
nr,       isiNdebele
nso,      Sesotho sa Leboa
nub,      Nubian Language
nv,       Navajo
nwc,      Classical Newari
ny,       Nyanja
nym,      Nyamwezi
nyn,      Nyankole
nyo,      Nyoro
nzi,      Nzima
oc,       occitan
oj,       Ojibwa
om,       Oromoo
or,       ଓଡ଼ିଆ
os,       Ossetic
osa,      Osage
ota,      Ottoman Turkish
oto,      Otomian Language
pa,       ਪੰਜਾਬੀ
paa,      Papuan Language
pag,      Pangasinan
pal,      Pahlavi
pam,      Pampanga
pap,      Papiamento
pau,      Palauan
peo,      Old Persian
phi,      Philippine Language
phn,      Phoenician
pi,       Pali
pl,       polski
pon,      Pohnpeian
pra,      Prakrit Language
pro,      Old Provençal
ps,       پښتو
pt,       português
pt_BR,    português do Brasil
pt_PT,    português europeu
qu,       Quechua
raj,      Rajasthani
rap,      Rapanui
rar,      Rarotongan
rm,       Rhaeto-Romance
rn,       Rundi
ro,       română
roa,      Romance Language
rom,      Romany
root,     Root
ru,       русский
rup,      Aromanian
rw,       Kinyarwanda
sa,       संस्कृत भाषा
sad,      Sandawe
sah,      Yakut
sai,      South American Indian Language
sal,      Salishan Language
sam,      Samaritan Aramaic
sas,      Sasak
sat,      Santali
sc,       Sardisch
scn,      Sicilian
sco,      Scots
sd,       السيندى
se,       davvisámegiella
sel,      Selkup
sem,      Semitic Language
sg,       Sango
sga,      Old Irish
sgn,      Sign Language
sh,       Srpskohrvatski
shn,      Shan
si,       සිංහල
sid,      Sidaamu Afo
sio,      Siouan Language
sit,      Sino-Tibetan Language
sk,       slovenčina
sl,       slovenščina
sla,      Slavic Language
sm,       Samoan
sma,      Southern Sami
smi,      Sami Language
smj,      Lule Sami
smn,      Inari Sami
sms,      Skolt Sami
sn,       shona
snk,      Soninke
so,       Soomaali
sog,      Sogdien
son,      Songhai
sq,       shqipe
sr,       Српски
srn,      Sranan Tongo
srr,      Serer
ss,       Siswati
ssa,      Nilo-Saharan Language
st,       Sesotho
su,       Sundanese
suk,      Sukuma
sus,      Susu
sux,      Sumerian
sv,       svenska
sw,       Kiswahili
syc,      Classical Syriac
syr,      ܣܘܪܝܝܐ
ta,       தமிழ்
tai,      Tai Language
te,       తెలుగు
tem,      Timne
ter,      Tereno
tet,      Tetum
tg,       Tajik
th,       ไทย
ti,       ትግርኛ
tig,      ትግረ
tiv,      Tiv
tk,       Turkmenisch
tkl,      Tokelau
tl,       Tagalog
tlh,      Klingon
tli,      Tlingit
tmh,      Tamashek
tn,       Setswana
to,       lea fakatonga
tog,      Nyasa Tonga
tpi,      Tok Pisin
tr,       Türkçe
ts,       Xitsonga
tsi,      Tsimshian
tt,       Татар
tum,      Tumbuka
tup,      Tupi Language
tut,      Altaic Language
tvl,      Tuvalu
tw,       特威文
ty,       Tahitian
tyv,      Tuvinian
udm,      Udmurt
ug,       Uighur
uga,      Ugaritic
uk,       українська
umb,      Umbundu
und,      Unknown or Invalid Language
ur,       اردو
uz,       Ўзбек
vai,      Vai
ve,       Tshivenḓa
vi,       Tiếng Việt
vo,       Volapük
vot,      Votic
wa,       Walloon
wak,      Wakashan Language
wal,      ወላይታቱ
war,      Waray
was,      Washo
wen,      Sorbian Language
wo,       Wolof
xal,      Kalmyk
xh,       isiXhosa
yao,      Yao
yap,      Yapese
yi,       Yiddish
yo,       Yorùbá
ypk,      Yupik Language
za,       Zhuang
zap,      Zapotec
zbl,      Blissymbols
zen,      Zenaga
zh,       中文
zh_Hans,  中文(简体)
zh_Hant,  中文(繁体)
znd,      Zande
zu,       isiZulu
zun,      Zuni
zxx,      No linguistic content
zza,      Zaza
I do not maintain a comments section. If you have any questions or comments regarding my posts, please do not hesitate to send me an e-mail to blog@stefan-koch.name.