User:Mathglot/sandbox/Templates/codeorlang-to-code
Appearance
Error: missing or invalid ISO-639 language name or code.
Documentation
Given an ISO-639 code or a language name, return an ISO-639 language code (or error message).
Usage
{{codeorlang-to-code|code}}
{{codeorlang-to-code|Language-name}}
Parameters
There is one required unnamed parameter:
|1=
– ISO-639 language code, or language name
Examples
{{codeorlang-to-code|tr}}
⟶ tr
{{codeorlang-to-code|Turkish}}
⟶ tr
{{codeorlang-to-code|xyz}}
⟶ Error: missing or invalid ISO-639 language name or code ('xyz').
{{codeorlang-to-code}}
⟶ Error: missing or invalid ISO-639 language name or code.