ಟೆಂಪ್ಲೇಟ್:Lang2iso/doc
This is a documentation subpage for ಟೆಂಪ್ಲೇಟ್:Lang2iso. It may contain usage information, categories and other content that is not part of the original ಟೆಂಪ್ಲೇಟ್ page. |
This template is used on many 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: |
Template:Lang2iso takes an English-language language name (such as "Abkhazian" or "Sinhalese") and converts it into a two-letter ISO 639 language code. This table's values are based on List of ISO 639-1 codes. The template should not be transcluded directly from article namespace.
Examples
ಸಂಪೊಲಿಪುಲೆ{{Lang2iso|German}}
returns: Lua error in package.lua at line 80: module 'Module:ISO 639 name/ISO 639 override' not found.{{Lang2iso|Greek}}
returns: Lua error in package.lua at line 80: module 'Module:ISO 639 name/ISO 639 override' not found.{{Lang2iso|Spanish}}
returns: Lua error in package.lua at line 80: module 'Module:ISO 639 name/ISO 639 override' not found.
Purpose
ಸಂಪೊಲಿಪುಲೆSince most users will know a language's name but not its ISO code, this template is meant to facilitate invocations of other templates such as Template:Lang. Thus, instead of recalling (or having to know) that the ISO code for German is "de" and transcluding {{Lang|de|Mädchen}}
, one can type: {{Lang|
.
{{subst:Lang2iso|German}}
|Mädchen}}
This also reduces the number of parameters that need to be passed to some language routines (such as those similar to Template:Language with name) since the ISO language code can now be derived from the ISO language name.
See also
ಸಂಪೊಲಿಪುಲೆ- {{ISO 639 name}}