Template:Engvar/doc
Jump to navigation
Jump to search
| 40px | This is a documentation subpage for Template:Engvar. It contains usage information, categories and other content that is not part of the original template page. |
Usage
This template can be used in templates that are used on pages with English language variants: articles in en-UK and articles in en-US. At the moment only UK and US English are recognised.
Article editor
When using the template in an article, the editor can set its parameter |engvar=en-UK. The template text now will use the provided en-UK variant of words. This parameter setting is only needed once in thetemplate.
In the template
So the template takes input parameter {{{engvar}}} Internally, the template has this construct:
...
| label= {{engvar| engvar={{{engvar}}} | en-uk=Football | en-us=Soccer }}
...
Depending on the engvar input, it returns oneofthevalues.
Notes
Language ids that are recognised are:
- In article code (article editor; case insensitive):
engval= en-UK, UK, en-uk, uk→ returns the en-UK valueengval= en-US, US, en-us, us→ returns the en-US value
- In template code (template editor):
- Here, always use the lowercase language id:
uk-en=Football(NOTuk-EN=Football) - Recognised language id's:
en-uk=, uk=, en-us=, us=
- Unnamed parameters in template code can be used:
- Unnamed parameter 1=pass throught the
{{{engvar}}}variable. Named:engvar={{{engvar}}} - Unnamed parameter 2=en-UK definition
- Unnamed parameter 3=en-US definition
<!-- The next three rows are equal in template code: -->
...
| label= {{engvar| engvar={{{engvar|}}} | en-uk=Football | en-us=Soccer }}
| label= {{engvar| 1={{{engvar|}}} | 2=Football | 3=Soccer }}
| label= {{engvar| 1={{{engvar|}}} | uk=Football | us=Soccer }}
...
Plain "en" variant
Default and plain "en"
- When the engvar=value from the article is not recognised, te