This is an old revision of this page, as edited by MSGJ (talk | contribs) at 20:11, 26 April 2009 (add a few more). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Revision as of 20:11, 26 April 2009 by MSGJ (talk | contribs) (add a few more)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff) Template documentation[view] [edit] [history] [purge]This 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}}
→
The error message can be suppressed with |hide-err=yes
:
{{ISO 639 name|sa-Latn|hide-err=yes}}
→
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}}
→
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}}
→
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
– returnstrue
if<code>
is found in any of the ISO 639 data tablesiso_639_code_to_name
– (default) as described aboveiso_639_code_1_to_name
– same asiso_639_code_to_name
except constrained to the ISO 639-1 data tableiso_639_code_2_to_name
– same asiso_639_code_to_name
except constrained to the ISO 639-2 data tableiso_639_code_2B_to_name
– same asiso_639_code_to_name
except constrained to the ISO 639-2B data tableiso_639_code_3_to_name
– same asiso_639_code_to_name
except constrained to the ISO 639-3 data tableiso_639_code_5_to_name
– same asiso_639_code_to_name
except constrained to the ISO 639-5 data tableiso_639_name_exists
– returnstrue
if<name>
is found in any of the ISO 639 data tablesiso_639_name_to_code
– returns language code associated with<name>
; may be constrained to a particular ISO 639 data tableiso_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 | ISO 639-2 | ISO 639-2B | ISO 639-3 | Name | Article |
---|---|---|---|---|---|
aa | Afar | Afar | |||
ab | Abkhaz | Abkhaz | |||
ae | Avestan | Avestan | |||
af | Afrikaans | Afrikaans | |||
ak | Akan | Akan | |||
am | Amharic | Amharic | |||
an | Aragonese | Aragonese | |||
ar | Arabic | Arabic | |||
as | Assamese | Assamese | |||
av | Avar | Avar | |||
ay | Aymara | Aymara | |||
az | Azerbaijani | Azerbaijani | |||
ba | Bashkir | Bashkir | |||
be | Belarusian | Belarusian | |||
bg | Bulgarian | Bulgarian | |||
bh | bih | Bihari | Bihari | ||
bi | Bislama | Bislama | |||
bm | Bambara | Bambara | |||
bn | Bengali | Bengali | |||
bo | Tibetan | Tibetan | |||
br | Breton | Breton | |||
bs | Bosnian | Bosnian | |||
ca | Catalan | Catalan | |||
ce | Chechen | Chechen | |||
ch | Chamorro | Chamorro | |||
co | Corsican | Corsican | |||
cr | Cree | Cree | |||
cs | Czech | Czech | |||
cu | Old Church Slavonic | Old Church Slavonic | |||
cv | Chuvash | Chuvash | |||
cy | Welsh | Welsh | |||
da | Danish | Danish | |||
de | German | German | |||
dv | Dhivehi | Dhivehi | |||
dz | Dzongkha | Dzongkha | |||
ee | Ewe | Ewe | |||
el | ell | gre | Greek | Greek | |
en | English | English | |||
eo | Esperanto | Esperanto | |||
es | Spanish | Spanish | |||
et | Estonian | Estonian | |||
eu | Basque | Basque | |||
fa | Persian | Persian | |||
ff | Fula | Fula | |||
fi | Finnish | Finnish | |||
fj | Fijian | Fijian | |||
fo | Faroese | Faroese | |||
fr | French | French | |||
fy | West Frisian | West Frisian | |||
ga | Irish | Irish | |||
gd | Scottish Gaelic | Scottish Gaelic | |||
gl | Galician language | Galician language | |||
gn | Guaraní | Guaraní | |||
gu | Gujarati | Gujarati | |||
gv | Manx | Manx | |||
ha | Hausa | Hausa | |||
he | Hebrew | Hebrew | |||
hi | Hindi | Hindi | |||
ho | Hiri Motu | Hiri Motu | |||
hr | Croatian | Croatian | |||
ht | Haitian Creole | Haitian Creole | |||
hu | Hungarian | Hungarian | |||
hy | Armenian | Armenian | |||
hz | Herero | Herero | |||
ia | Interlingua | Interlingua | |||
id | Indonesian | Indonesian | |||
ie | Interlingue | Interlingue | |||
ig | Igbo | Igbo | |||
ii | Yi | Yi | |||
ik | Inupiaq | Inupiaq | |||
io | Ido | Ido | |||
is | Icelandic | Icelandic | |||
it | Italian | Italian | |||
iu | Inuktitut | Inuktitut | |||
ja | Japanese | Japanese | |||
jv | Javanese | Javanese | |||
ka | Georgian | Georgian | |||
kg | Kongo | Kongo | |||
ki | Gikuyu | Gikuyu | |||
kj | Kwanyama | Kwanyama | |||
kk | Kazakh | Kazakh | |||
kl | Kalaallisut | Kalaallisut | |||
km | khm | Khmer | Khmer | ||
kn | Kannada | Kannada | |||
ko | Korean | Korean | |||
kr | Kanuri | Kanuri | |||
ks | Kashmiri | Kashmiri | |||
ku | Kurdish | Kurdish | |||
kv | Komi | Komi | |||
kw | Cornish | Cornish | |||
ky | Kyrgyz | Kyrgyz | |||
la | Latin | Latin | |||
lb | Luxembourgish | Luxembourgish | |||
lg | Luganda | Luganda | |||
li | Limburgish | Limburgish | |||
ln | Lingala | Lingala | |||
lo | Lao | Lao | |||
lt | Lithuanian | Lithuanian | |||
lu | Tshiluba | Tshiluba | |||
lv | Latvian | Latvian | |||
mg | Malagasy | Malagasy | |||
mh | Marshallese | Marshallese | |||
mi | Māori | Māori | |||
mk | Macedonian | Macedonian | |||
ml | Malayalam | Malayalam | |||
mn | Mongolian | Mongolian | |||
mr | Marathi | Marathi | |||
ms | msa | may | Malay | Malay | |
mt | Maltese | Maltese | |||
my | Burmese | Burmese | |||
na | Nauruan | Nauruan | |||
nb | Bokmål | Bokmål | |||
nd | North Ndebele | North Ndebele | |||
ne | nep | Nepali | Nepali | ||
ng | Ndonga | Ndonga | |||
nl | Dutch | Dutch | |||
nn | Nynorsk | Nynorsk | |||
no | Norwegian | Norwegian | |||
nr | Southern Ndebele | Southern Ndebele | |||
nv | Navajo | Navajo | |||
ny | Chichewa | Chichewa | |||
oc | Occitan | Occitan | |||
oj | Anishinaabe | Anishinaabe | |||
om | Oromo | Oromo | |||
or | ori | Oriya | Oriya | ||
os | Ossetic | Ossetic | |||
pa | Punjabi | Punjabi | |||
pi | Pāli | Pāli | |||
pl | Polish | Polish | |||
ps | Pashto | Pashto | |||
pt | Portuguese | Portuguese | |||
qu | Quechua | Quechua | |||
rm | Romansh | Romansh | |||
rn | Kirundi | Kirundi | |||
ro | Romanian | Romanian | |||
ru | Russian | Russian | |||
rw | Kinyarwanda | Kinyarwanda | |||
sa | Sanskrit | Sanskrit | |||
sc | Sardinian | Sardinian | |||
sd | Sindhi | Sindhi | |||
se | Northern Sami | Northern Sami | |||
sg | Sango | Sango | |||
sh | Serbo-Croatian | Serbo-Croatian | |||
si | Sinhala | Sinhala | |||
sk | Slovak | Slovak | |||
sl | Slovenian | Slovenian | |||
sm | Samoan | Samoan | |||
sn | Shona | Shona | |||
so | Somali | Somali | |||
sq | Albanian | Albanian | |||
sr | Serbian | Serbian | |||
ss | Swati | Swati | |||
st | sot | Sotho | Sotho | ||
su | Sundanese | Sundanese | |||
sv | Swedish | Swedish | |||
sw | swa | Swahili | Swahili | ||
ta | Tamil | Tamil | |||
te | Telugu | Telugu | |||
tg | Tajik | Tajik | |||
th | Thai | Thai | |||
ti | Tigrinya | Tigrinya | |||
tk | Turkmen | Turkmen | |||
tl | Tagalog | Tagalog | |||
tn | Tswana | Tswana | |||
to | Tongan | Tongan | |||
tr | Turkish | Turkish | |||
ts | Tsonga | Tsonga | |||
tt | Tatar | Tatar | |||
tw | Twi | Twi | |||
ty | Tahitian | Tahitian | |||
ug | Uyghur | Uyghur | |||
uk | Ukrainian | Ukrainian | |||
ur | Urdu | Urdu | |||
uz | Uzbek | Uzbek | |||
ve | Venda | Venda | |||
vi | Vietnamese | Vietnamese | |||
vo | Volapük | Volapük | |||
wa | Walloon | Walloon | |||
wo | Wolof | Wolof | |||
xh | Xhosa | Xhosa | |||
yi | Yiddish | Yiddish | |||
yo | Yoruba | Yoruba | |||
za | Zhuang | Zhuang | |||
zh | Chinese | Chinese | |||
zu | Zulu | Zulu |
Notes
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()
andiso_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
- Category:Lang-x templates
- Category:Lang-x templates with other than ISO 639
- Category:Articles containing non-English-language text
- {{lang}}
- {{mw lang}}
- {{language with name}}
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: