Template:Engvar/doc

From blackwiki
< Template:Engvar
Revision as of 23:22, 21 June 2012 by 200.114.132.36 (talk) (reverting idiot's edit)
Jump to navigation Jump to search

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:

  1. In article code (article editor; case insensitive):
  • engval= en-UK, UK, en-uk, uk → returns the en-UK value
  • engval= en-US, US, en-us, us → returns the en-US value
  1. In template code (template editor):
  • Here, always use the lowercase language id: uk-en=Football (NOT uk-EN=Football)
  • Recognised language id's: en-uk=, uk=, en-us=, us=
  1. 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"

  1. When the engvar=value from the article is not recognised, te

See also