Lompat ke isi

Cèṭa'an:Engvar/doc

Ḍâri Wikipèḍia bhâsa Madhurâ, lombhung pangataowan mardhika

TemplateStyles' src attribute must not be empty.

TemplateStyles' src attribute must not be empty.

TemplateStyles' src attribute must not be empty.

This template is used inside other templates. 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.

  1. Articles specify the English variety parameter for relevant templates like {{example|engvar=en-US}}. They do not use {{engvar}}.
  2. Templates use {{engvar}}. It should not forget to pass-through |engvar={{{engvar|}}}
...
| label3 = {{engvar |defaultWord=Colour |defaultLang=en-UK |en-US=Color |engvar={{{engvar|auto}}} }}
|  data3 = {{{color|}}}
| label4 = {{engvar |defaultWord=Football |defaultLang=en-UK |en-US=Soccer |engvar={{{engvar|auto}}} }} team
|  data4 = {{{team|}}}
...

The |defaultWord= be shown by default. But if an article asks for an English variety that has a corresponding parameter specified in the template, the value will be shown.

In the example, the template specified a British English word as default whenever no |engvar= is specified by the article. The word can be changed in an American English article by that article specifying |engvar=en-US. The fallback 'auto' value means it will try to determine the language based on templates like {{Use British English}} or {{Use American English}} being present on the page if no engvar is specified.

Note: {{engvar}} is unrelated to parameter names like |color= vs. |colour=. See programming option |data3={{{color|{{{colour|}}} }}}

Consider an example template, a fictive {{infobox personal likes}}. The demo is encoded in {{Engvar/doc/infobox demo}}.

Template code

[beccè' sombher]
[[:Cèṭa'an:Engvar/doc/infobox demo]]

Three articles

[beccè' sombher]

Cèṭa'an:Engvar/doc/infobox demo

{{Engvar/doc/infobox demo
| home country = Wales
| color = Blue
| team  = [[FC Kuusysi]]
<!-- |engvar= not set; expect defaults -->
}}

Cèṭa'an:Engvar/doc/infobox demo

{{Engvar/doc/infobox demo
| home country = Alaska
| color = Blue
| team  = [[FC Kuusysi]]
| engvar= en-US
}}

Cèṭa'an:Engvar/doc/infobox demo

{{Engvar/doc/infobox demo
| home country = Australia
| color = Blue
| team  = [[FC Kuusysi]]
| engvar= Australian
}}

A live example

[beccè' sombher]

Currently, {{infobox element}} has five {{engvar}} words. Phosphorus shows |engvar=en-UK despite the |engvar=en-US default.

Parameter list

[beccè' sombher]

Template

[beccè' sombher]
{{engvar
| 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'. -->
}}
{{example
| engvar =
| engvarCat =
}}

List of English varieties

[beccè' sombher]

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.

Maintenance category

[beccè' sombher]

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=no in 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".

Template data

[beccè' sombher]
Ariya dokumenna TemplateData ka'angghuy template nèka èghuna'aghi bi' VisualEditor tor alat laènna; see a monthly parameter usage report for this template in articles.

TemplateData untuk Engvar

Tidak ada keterangan.

Parameter templat

ParameterKeteranganJenisStatus
Default spellingdefaultword

The default word, usually the word in the English variety most often used

Contoh
colour
Katadisarankan
Default English varietydefaultLang

Adding this helps document your {{engvar}} setting

Nilai yang disarankan
en-US en-AU en-GB en-CA en-EI en-HK en-IN en-JM en-MW en-NZ en-NG en-PK en-PH en-SCO en-SG en-ZA en-TT en-OED en-IUPAC
Contoh
en-US
Katadisarankan
English varietyengvar

English variety to use. Set to 'auto' to try to detect variety based on templates such as {{Use British English}} or {{EngvarB}} being present on the page.

Nilai yang disarankan
{{{engvar|auto}}} {{{engvar|}}} auto
Katawajib diisi
Suppress maintenance categoryengvarCat

tidak ada keterangan

Nilai yang disarankan
{{{engvarCat|yes}}} no
Baku
yes
Katadisarankan
Fallbackfallback

Whether Commonwealth English languages should fallback to en-GB if not specified

Baku
false unless engvar=auto
Booleanopsional
Maintenance category sort keyengvarCatSort

tidak ada keterangan

Baku
{{pagename}}
Kataopsional
American English spellingen-US

tidak ada keterangan

Contoh
color
Kataopsional
Australian English spellingen-AU

tidak ada keterangan

Kataopsional
British English spellingen-GB

tidak ada keterangan

Kataopsional
Canadian English spellingen-CA

tidak ada keterangan

Kataopsional
Hiberno-English (Irish-English) spellingen-EI

tidak ada keterangan

Kataopsional
Hong Kong English spellingen-HK

tidak ada keterangan

Kataopsional
Indian English spellingen-IN

tidak ada keterangan

Kataopsional
Jamaican English spellingen-JM

tidak ada keterangan

Kataopsional
Malawian English spellingen-MW

tidak ada keterangan

Kataopsional
New Zealand English spellingen-NZ

tidak ada keterangan

Kataopsional
Nigerian English spellingen-NG

tidak ada keterangan

Kataopsional
Pakistani English spellingen-PK

tidak ada keterangan

Kataopsional
Philippine English spellingen-PH

tidak ada keterangan

Kataopsional
Scottish English spellingen-SCO

tidak ada keterangan

Kataopsional
Singapore English spellingen-SG

tidak ada keterangan

Kataopsional
South African English spellingen-ZA

tidak ada keterangan

Kataopsional
Trinidadian English spellingen-TT

tidak ada keterangan

Kataopsional
British (Oxford) English spellingen-OED

tidak ada keterangan

Kataopsional
IUPAC spellingen-IUPAC

tidak ada keterangan

Kataopsional

See also

[beccè' sombher]
  • HELP:ENGVAR
  • Category:Articles using an unknown Template:Engvar option
  • ISO 3166-1 alpha-2 -- The 2-letter country code
  • TemplateStyles' src attribute must not be empty. - debugging