Module:Engvar/doc
| This Lua module is used on approximately 17,000 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
| This module depends on the following other modules: |
This module implements {{engvar}}. It allows templates to show national varieties of English, when |engvar= is passed by each article.
For example, one template can display "football" for |engvar=en-UK articles, and "soccer" for |engvar=en-US articles.
Parameter list
Template
{{#invoke:engvar|variants
| defaultWord =
| defaultLang =
| engvar = <!-- Pass-through the editor's choice, set to 'auto' to automatically detect -->
| en-XX = <!-- add country code for XX, and the nation language word -->
| en-YY = <!-- add more varieties as might be needed -->
| engvarCat = <!-- '=no' will suppress message category in article page -->
| fallback = <!-- set to 'true' to allow commonwealth languages to fallback to 'en-GB'. False by default unless engvar='auto'. -->
}}
Article
{{example
| engvar =
| engvarCat =
}}
Maintenance category
Articles with an invalid |engvar= will be placed in the hidden maintenance category Category:Articles using an unknown Template:Engvar option. Articles listed may need editing.
An article's requested |engvar= may be unspecified in the template. For example, if an article uses {{example|engvar=South African English}} but the template has no |en-ZA=, then the template will return |defaultWord=default color name. The category will not be used.
- When this categorization is not desired for a whole template, set
|engvarCat=noin the template - Otherwise pass-through this setting from the article:
|engvarCat={{{engvarCat|yes}}}. This allows the editor to switch categorization off per article.
Articles are sorted by |engvarCatSort= or {{pagename}} by default. Note that other templates will fill this category. Set this parameter like |engvarCatSort=Personal prefs in a template to group its listings under "P".
List of English varieties
In the template, use the exact ISO-code as the parameter name like |en-GB=vapour. Write |en-US=soccer not |American English=soccer. Needed varieties have articles using the template and words differing from the default.
| English variety | ISO-code |
|---|---|
| American English | en-US
|
| Australian English | en-AU
|
| British English | en-GB
|
| Canadian English | en-CA
|
| Hiberno-English (Irish English) | en-EI
|
| Hong Kong English | en-HK
|
| Indian English | en-IN
|
| Jamaican English | en-JM
|
| Malawian English | en-MW
|
| New Zealand English | en-NZ
|
| Nigerian English | en-NG
|
| Pakistani English | en-PK
|
| Philippine English | en-PH
|
| Scottish English | en-SCO
|
| Singapore English | en-SG
|
| South African English | en-ZA
|
| Trinidadian English | en-TT
|
| British English Oxford spelling British (Oxford) English Oxford English Dictionary (OED) |
en-OED
|
| IUPAC spelling | en-IUPAC
|
There is backwards compatibility for leeway in articles. |engvar=en-US, |engvar=United States, |engvar=US can all show the |en-US=football variety.
See also
- HELP:ENGVAR
- Category:Articles using an unknown Template:Engvar option
- ISO 3166-1 alpha-2 -- The 2-letter country code
- {{#invoke:Engvar|explain|...}} - debugging
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.