Misplaced Pages

Template:ISO 639 name: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 16:47, 28 April 2009 view sourceAmalthea (talk | contribs)31,926 editsm Change error message to use class="error", which is recognized by the parser function #iferror.← Previous edit Revision as of 18:02, 28 April 2009 view source WOSlinker (talk | contribs)Administrators854,881 edits add parameter #2 to allow for different default if code not found, e.g. {{ISO 639 name|xx|Unknown Language}}Next edit →
Line 186: Line 186:
|zh|chi|zho=Chinese |zh|chi|zho=Chinese
|zu|zul=Zulu |zu|zul=Zulu
|#default=<span class="error">'''Language abbreviation not recognized by ]!'''</span> |#default={{{2|<span class="error">'''Language abbreviation not recognized by ]!'''</span>}}}
}}<noinclude> }}<noinclude>
{{Documentation}} {{Documentation}}

Revision as of 18:02, 28 April 2009

Language abbreviation not recognized by template!

Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 8,900 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
This template uses Lua:
Language templates
Language names (ISO 639)
Interwiki links
Foreign-language text
Other

Usage

The {{ISO 639 name}} template is used to resolve ISO 639-1, ISO 639-2, ISO 639-3 and ISO 639-5 codes to language names. It will trim extraneous IETF language tags to just the ISO 639 code. E.g.: Sanskrit in Latin script, which IETF language tag is sa-Latn, renders as:

  • {{ISO 639 name|sa-Latn}}Language abbreviation not recognized by template!

The error message can be suppressed with |hide-err=yes:

  • {{ISO 639 name|sa-Latn|hide-err=yes}}Language abbreviation not recognized by template!

The rendered language name can be linked to the appropriate language article with |link=yes:

  • {{ISO 639 name|sa-Latn|hide-err=yes|link=yes}}Language abbreviation not recognized by template!

When linking, an alternate link label can be provided with |label=<label text>:

  • {{ISO 639 name|sa-Latn|hide-err=yes|link=yes|label=sa-Latn}}Language abbreviation not recognized by template!

The {{ISO 639 name link}} template is the same as {{ISO 639 name}} except that it presets |link=yes.

Both of these templates can be safely substituted.

Other functions

This template can be used to execute any of the functions exported by Module:ISO 639 name. These function are:

  • iso_639_code_exists – returns true if <code> is found in any of the ISO 639 data tables
  • iso_639_code_to_name – (default) as described above
  • iso_639_code_1_to_name – same as iso_639_code_to_name except constrained to the ISO 639-1 data table
  • iso_639_code_2_to_name – same as iso_639_code_to_name except constrained to the ISO 639-2 data table
  • iso_639_code_2B_to_name – same as iso_639_code_to_name except constrained to the ISO 639-2B data table
  • iso_639_code_3_to_name – same as iso_639_code_to_name except constrained to the ISO 639-3 data table
  • iso_639_code_5_to_name – same as iso_639_code_to_name except constrained to the ISO 639-5 data table
  • iso_639_name_exists – returns true if <name> is found in any of the ISO 639 data tables
  • iso_639_name_to_code – returns language code associated with <name>; may be constrained to a particular ISO 639 data table
  • iso_639 – returns language name when given a valid language code; returns a language code when given a valid language name; may be constrained to a particular ISO 639 data table

To use these functions set |fn= to the appropriate function name.

Language codes

ISO 639-1 codes and matching codes from ISO 639-2, -2B, and -3
ISO 639-1 ISO 639-2 ISO 639-2B ISO 639-3 Name Article
aa 2 2B 3 Afar Afar
ab 2 2B 3 Abkhaz Abkhaz
ae 2 2B 3 Avestan Avestan
af 2 2B 3 Afrikaans Afrikaans
ak 2 2B 3 Akan Akan
am 2 2B 3 Amharic Amharic
an 2 2B 3 Aragonese Aragonese
ar 2 2B 3 Arabic Arabic
as 2 2B 3 Assamese Assamese
av 2 2B 3 Avar Avar
ay 2 2B 3 Aymara Aymara
az 2 2B 3 Azerbaijani Azerbaijani
ba 2 2B 3 Bashkir Bashkir
be 2 2B 3 Belarusian Belarusian
bg 2 2B 3 Bulgarian Bulgarian
bh bih Bihari Bihari
bi 2 2B 3 Bislama Bislama
bm 2 2B 3 Bambara Bambara
bn 2 2B 3 Bengali Bengali
bo 2 2B 3 Tibetan Tibetan
br 2 2B 3 Breton Breton
bs 2 2B 3 Bosnian Bosnian
ca 2 2B 3 Catalan Catalan
ce 2 2B 3 Chechen Chechen
ch 2 2B 3 Chamorro Chamorro
co 2 2B 3 Corsican Corsican
cr 2 2B 3 Cree Cree
cs 2 2B 3 Czech Czech
cu 2 2B 3 Old Church Slavonic Old Church Slavonic
cv 2 2B 3 Chuvash Chuvash
cy 2 2B 3 Welsh Welsh
da 2 2B 3 Danish Danish
de 2 2B 3 German German
dv 2 2B 3 Dhivehi Dhivehi
dz 2 2B 3 Dzongkha Dzongkha
ee 2 2B 3 Ewe Ewe
el ell gre 3 Greek Greek
en 2 2B 3 English English
eo 2 2B 3 Esperanto Esperanto
es 2 2B 3 Spanish Spanish
et 2 2B 3 Estonian Estonian
eu 2 2B 3 Basque Basque
fa 2 2B 3 Persian Persian
ff 2 2B 3 Fula Fula
fi 2 2B 3 Finnish Finnish
fj 2 2B 3 Fijian Fijian
fo 2 2B 3 Faroese Faroese
fr 2 2B 3 French French
fy 2 2B 3 West Frisian West Frisian
ga 2 2B 3 Irish Irish
gd 2 2B 3 Scottish Gaelic Scottish Gaelic
gl 2 2B 3 Galician language Galician language
gn 2 2B 3 Guaraní Guaraní
gu 2 2B 3 Gujarati Gujarati
gv 2 2B 3 Manx Manx
ha 2 2B 3 Hausa Hausa
he 2 2B 3 Hebrew Hebrew
hi 2 2B 3 Hindi Hindi
ho 2 2B 3 Hiri Motu Hiri Motu
hr 2 2B 3 Croatian Croatian
ht 2 2B 3 Haitian Creole Haitian Creole
hu 2 2B 3 Hungarian Hungarian
hy 2 2B 3 Armenian Armenian
hz 2 2B 3 Herero Herero
ia 2 2B 3 Interlingua Interlingua
id 2 2B 3 Indonesian Indonesian
ie 2 2B 3 Interlingue Interlingue
ig 2 2B 3 Igbo Igbo
ii 2 2B 3 Yi Yi
ik 2 2B 3 Inupiaq Inupiaq
io 2 2B 3 Ido Ido
is 2 2B 3 Icelandic Icelandic
it 2 2B 3 Italian Italian
iu 2 2B 3 Inuktitut Inuktitut
ja 2 2B 3 Japanese Japanese
jv 2 2B 3 Javanese Javanese
ka 2 2B 3 Georgian Georgian
kg 2 2B 3 Kongo Kongo
ki 2 2B 3 Gikuyu Gikuyu
kj 2 2B 3 Kwanyama Kwanyama
kk 2 2B 3 Kazakh Kazakh
kl 2 2B 3 Kalaallisut Kalaallisut
km khm 2B 3 Khmer Khmer
kn 2 2B 3 Kannada Kannada
ko 2 2B 3 Korean Korean
kr 2 2B 3 Kanuri Kanuri
ks 2 2B 3 Kashmiri Kashmiri
ku 2 2B 3 Kurdish Kurdish
kv 2 2B 3 Komi Komi
kw 2 2B 3 Cornish Cornish
ky 2 2B 3 Kyrgyz Kyrgyz
la 2 2B 3 Latin Latin
lb 2 2B 3 Luxembourgish Luxembourgish
lg 2 2B 3 Luganda Luganda
li 2 2B 3 Limburgish Limburgish
ln 2 2B 3 Lingala Lingala
lo 2 2B 3 Lao Lao
lt 2 2B 3 Lithuanian Lithuanian
lu 2 2B 3 Tshiluba Tshiluba
lv 2 2B 3 Latvian Latvian
mg 2 2B 3 Malagasy Malagasy
mh 2 2B 3 Marshallese Marshallese
mi 2 2B 3 Māori Māori
mk 2 2B 3 Macedonian Macedonian
ml 2 2B 3 Malayalam Malayalam
mn 2 2B 3 Mongolian Mongolian
mr 2 2B 3 Marathi Marathi
ms msa may 3 Malay Malay
mt 2 2B 3 Maltese Maltese
my 2 2B 3 Burmese Burmese
na 2 2B 3 Nauruan Nauruan
nb 2 2B 3 Bokmål Bokmål
nd 2 2B 3 North Ndebele North Ndebele
ne nep 2B 3 Nepali Nepali
ng 2 2B 3 Ndonga Ndonga
nl 2 2B 3 Dutch Dutch
nn 2 2B 3 Nynorsk Nynorsk
no 2 2B 3 Norwegian Norwegian
nr 2 2B 3 Southern Ndebele Southern Ndebele
nv 2 2B 3 Navajo Navajo
ny 2 2B 3 Chichewa Chichewa
oc 2 2B 3 Occitan Occitan
oj 2 2B 3 Anishinaabe Anishinaabe
om 2 2B 3 Oromo Oromo
or ori 2B 3 Oriya Oriya
os 2 2B 3 Ossetic Ossetic
pa 2 2B 3 Punjabi Punjabi
pi 2 2B 3 Pāli Pāli
pl 2 2B 3 Polish Polish
ps 2 2B 3 Pashto Pashto
pt 2 2B 3 Portuguese Portuguese
qu 2 2B 3 Quechua Quechua
rm 2 2B 3 Romansh Romansh
rn 2 2B 3 Kirundi Kirundi
ro 2 2B 3 Romanian Romanian
ru 2 2B 3 Russian Russian
rw 2 2B 3 Kinyarwanda Kinyarwanda
sa 2 2B 3 Sanskrit Sanskrit
sc 2 2B 3 Sardinian Sardinian
sd 2 2B 3 Sindhi Sindhi
se 2 2B 3 Northern Sami Northern Sami
sg 2 2B 3 Sango Sango
sh 2B 3 Serbo-Croatian Serbo-Croatian
si 2 2B 3 Sinhala Sinhala
sk 2 2B 3 Slovak Slovak
sl 2 2B 3 Slovenian Slovenian
sm 2 2B 3 Samoan Samoan
sn 2 2B 3 Shona Shona
so 2 2B 3 Somali Somali
sq 2 2B 3 Albanian Albanian
sr 2 2B 3 Serbian Serbian
ss 2 2B 3 Swati Swati
st sot 2B 3 Sotho Sotho
su 2 2B 3 Sundanese Sundanese
sv 2 2B 3 Swedish Swedish
sw swa 2B 3 Swahili Swahili
ta 2 2B 3 Tamil Tamil
te 2 2B 3 Telugu Telugu
tg 2 2B 3 Tajik Tajik
th 2 2B 3 Thai Thai
ti 2 2B 3 Tigrinya Tigrinya
tk 2 2B 3 Turkmen Turkmen
tl 2 2B 3 Tagalog Tagalog
tn 2 2B 3 Tswana Tswana
to 2 2B 3 Tongan Tongan
tr 2 2B 3 Turkish Turkish
ts 2 2B 3 Tsonga Tsonga
tt 2 2B 3 Tatar Tatar
tw 2 2B 3 Twi Twi
ty 2 2B 3 Tahitian Tahitian
ug 2 2B 3 Uyghur Uyghur
uk 2 2B 3 Ukrainian Ukrainian
ur 2 2B 3 Urdu Urdu
uz 2 2B 3 Uzbek Uzbek
ve 2 2B 3 Venda Venda
vi 2 2B 3 Vietnamese Vietnamese
vo 2 2B 3 Volapük Volapük
wa 2 2B 3 Walloon Walloon
wo 2 2B 3 Wolof Wolof
xh 2 2B 3 Xhosa Xhosa
yi 2 2B 3 Yiddish Yiddish
yo 2 2B 3 Yoruba Yoruba
za 2 2B 3 Zhuang Zhuang
zh 2 2B 3 Chinese Chinese
zu 2 2B 3 Zulu Zulu

Notes

  1. There are only 20 ISO 639-2B codes.
  2. ^ Code not assigned.

Examples

  • {{ISO 639 name|en}} gives English
  • {{ISO 639 name|fr}} gives French

Error messages

This template produces error messages. These messages are:

  • <code> is an IETF tag – IETF language tags are not ISO 639 language codes. When these tags are encountered, the template attempts to render the correct language and also emits this error message
  • ISO 639-<part> code is required – where <part> is 1, 2, 3, 5; template was called without the required language code
  • <code> is not an ISO 639-<part> code – <code> fails simple length validation; 639 part 1, language codes are two characters, for 639 parts 2, 3, and 5, language codes are three characters
  • <code> not found in ISO 639-<part> list – <code> not found after searching ISO 639-<part> data

The module that does the work for this template has other functionality not supported by this template. See Module:ISO 639 name. Error messages related to that other functionality are:

  • language name required – module function iso_639_name_to_code() only – this message emitted when a language name is not provided in the {{#invoke:}}
  • <part> not an ISO 639 part – module functions iso_639_name_to_code() and iso_639() only – this message emitted when <part> is not one of 1, 2, 3, or 5
  • language code or name required – module function iso_639() only – this message emitted when a language name or a language code is not provided in the {{#invoke:}}

Tracking categories

See also

The above documentation is transcluded from Template:ISO 639 name/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template. Category: