Jump to content

ထႅမ်းပလဵတ်ႉ:Engvar

လုၵ်ႉတီႈ ဝီႇၶီႇၽီးတီးယႃး ဢၼ်လွတ်ႈလႅဝ်းထၢင်ႇႁၢင်ႈ ၼၼ်ႉမႃး
Documentation icon ၽိုၼ်ၵႅမ်မိုဝ်းထႅမ်းပလဵတ်ႉ[တူၺ်း] [မႄးထတ်း] [ပိုၼ်း] [ၸၢင်း]

This template can be used inside a template. It allows the template to show national variants of English (WP:ENGVAR), depending on the individual article preference.

For example, the same template can show the word "football" text in en-UK articles, and "soccer" in en-US articles.

လွင်ႈၸႂ်ႉတိုဝ်း

[မႄးထတ်းငဝ်ႈငႃႇ]
1. For the editors, add the parameter

Add |engvar= to the parameter list. To be used in an article. With this parameter an editor sets a variant Engvar language: |engvar=en-US.

2. Inside the template code, add like
...
|label3 = {{engvar |defaultWord=Colour |defaultLang=en-UK |en-US=Color |engvar={{{engvar|}}} }}
| data3 = {{{color|}}}
...

First, the |defaultWord= entered in the template will be shown. But when an article asks for a variant language, that alternative word —when found in the list—will be shown. The article editor has some freedom in words: |engvar=en-US, |engvar=United States, |engvar=US all lead to the listed |en-US=football variant.

Note that the template parameter (user value) is passed through: |engvar={{{engvar|}}}

In the example, the template shows the default word being the en-UK one (without the article editor taking any action in this). In an en-US language article, the word can be changed.

  • This template can be reused in the template, with the same |engvar= choice taking effective:
...
| label4 = {{engvar|defaultWord=Football |defaultLang=en-UK |en-US=Soccer |engvar={{{engvar|}}} }} team
|  data4 = {{{team|}}}
...


Note: Parameter names like |color= vs. |colour= are not affected at all. Existing names do not change by this template in any way. (See programming option |data3 = {{{color|{{{colour|}}} }}})

တူဝ်ယၢင်ႇ

[မႄးထတ်းငဝ်ႈငႃႇ]

Below is an example template, a fictive {{infobox personal likes}}. The demo is encoded in {{Engvar/infobox demo}}. Template code

{{infobox
| title   = Personal likes
| headerstyle=background:lemonchiffon
| label1  = Home country
|  data1  = {{{home country|}}}
| header2 = Favorite things
|  label3 = {{engvar|defaultWord=Colour |defaultLang=en-UK | engvar={{{engvar|}}}
            |en-US=Color }}
|  data3  = {{{color|}}}
| label4  = {{engvar|defaultWord=Football |defaultLang=en-UK | engvar={{{engvar|}}}
            |en-US=Soccer |en-AU=Association Football}} team
|  data4  = {{{team|}}}}}

Three articles:

Personal likes
Demo: using WP:Engvar in templates
Home country Wales
Favorite things
Colour Blue
Football team FC Kuusysi
In this demo 'article', template parameter is set: |engvar=
{{Engvar/infobox demo
| home country = Wales
| color = Blue
| team  = [[FC Kuusysi]]
| engvar=<!-- not set; expect defaults -->
}}
Personal likes
Demo: using WP:Engvar in templates
Home country Alaska
Favorite things
Color Blue
Soccer team FC Kuusysi
In this demo 'article', template parameter is set: |engvar=en-US
{{Engvar/infobox demo
| home country = Alaska
| color = Blue
| team  = [[FC Kuusysi]]
| engvar = en-US
}}
Personal likes
Demo: using WP:Engvar in templates
Home country Australia
Favorite things
Colour Blue
Association Football team FC Kuusysi
In this demo 'article', template parameter is set: |engvar=Australian
{{Engvar/infobox demo
| home country = Australia
| color = Blue
| team  = [[FC Kuusysi]]
| engvar = Australian
}}

A live example Currently, {{infobox element}} has five {{engvar}} words. Default is en-US, and phosphorus shows its setting is |engvar=en-UK.

| defaultWord =
| defaultLang =
| engvar = {{{engvar|}}}
| en-XX = <!-- Add country code for XX, and the nation language word -->
| en-YY = <!-- Add more variants as might be needed -->
| engvarCat = {{{engvarCat|}}}<!-- '=no' will suppress message category in article page) -->
|defaultWord=
The word (or sentence) that will be shown by default. Pick the language one that is most often used (no preference involved).
|engvar=
Add | engvar = {{{engvar|}}} to the template. This passes through the article's setting to the internal Engvar template for processing.
|en-XX=, |en-YY=
Add the alternative language variant(s). Only those languages (words) that differ from the default are needed. Also, only list the languages that are likely to be used in the template. Will the template be used in Jamaican English language articles?
In the template code, use the listed codes only: en-UK=, en-AU=, en-OED=, etcetera. So in the template code, write |en-US=soccer, not |American English=soccer (the textual freedom is available for the article editor).
|defaultLang=
Not required. Use an =en-ZZ code. Adding this helps documenting your {{engvar}} setting. See also Maintenance category below.
|engvarCat=
|engvarCat=no will suppress (prevent) the maintenance category to be added to an article page. See Maintenance category below.

In the

| defaultWord =
| defaultLang =
| engvar = {{{engvar|}}}<!-- Pass through the editor's choice -->
| en-XX = <!-- add country code for XX, and the nation language word -->
| en-YY = <!-- add more variants as might be needed -->
| engvarCat = {{{engvarCat|}}} <!-- '=no' will suppress message category in article page) -->

In the parameter list, for the editor to see & use:

| engvar =
| engvarCat =

List of variant languages

[မႄးထတ်းငဝ်ႈငႃႇ]

In the template code, use the exact ISO-code as parameter name: |en-GB=vapour (The need for precision it with the template encoder. Then for the article editor are the leeways such as variant language names).

Language 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


Articles that can not resolve the Engvar request (The |engvar= for the template can not be resolved), will be placed in the hidden maintenance category:

Category:Articles using an unknown Template:Engvar option

Articles listed here can indicate that the may need adjustment (or the article needs a correction).

The editors Engvar request may not be available in your template code. For example, an |engvar=South African English is asked for, but is not in the variants list you entered, so can not be honored (the defaultWord is shown). You can check the maintenance category for those requests, and maybe improve the template.

When this categorization is not wanted desired for a page or a whole tempalte, parameter |engvarCat=no can be set in code for the whole of the template ( = the template will never add this category).
The template can also 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 all templates will be filling this category. Set this parameter to group all template reports (e.g. |engvarCatSort=Personal prefs will group this templates listings under "P").

  • The module has a debugging option {{#invoke:Engvar|explain|...}} to give feedback on the arguments entered.
ၶေႃႈမုၼ်းၸိူဝ်းၽၢႆႇတႂ်ႈၼႆႉ ပဵၼ် တူဝ်ထတ်းတႃႁၼ်(VisualEditor) ဢၼ်မီးတီႈ ဝီႇၶီႇၽီးတီးယႃးၼၼ်ႉ ယိူင်းဢၢၼ်း တႃႇဢဝ် ၶိူင်ႈၸိူဝ်းၼၼ်ႉ ၸႂ်ႉလႆႈတီႈ ဝီႇၶီႇၽီးတီးယႃးတႆးသေ ၸင်ႇလႆႈဢဝ် ပိူင် ၶေႃႈမုၼ်းထႅမ်းပလဵၵ်ႉ (TemplateData) ဢၼ်မီးတီႈ ဝီႇၶီႇၽီးတီးယႃး ဢိင်းၵလဵတ်ႈၼၼ်ႉ ႁဵတ်းဝႆႉပဵၼ် တီႈမၢႆတီႈတွင်းယဝ်ႉ။ ႁူမ်ႈဝႃႈ ပႆႇၸႂ်ႉၶိူင်ႈၸိူဝ်းၼၼ်ႉသေတႃႉ ပေႃးပဵၼ် ၵူၼ်းႁူႉလွင်ႈတႅမ်ႈပရူဝ်ႇၵရႅမ်ႇ (computer programming) ဢိတ်းဢွတ်းၵေႃႈ ႁႂ်ႈပေႃးႁၼ်လႆႈၸႅင်ႈလႅင်းလီၼႆသေ ၸၢင်ႈဢဝ်ၸႂ်ႉလႆႈ သၽေႃးတီႈၵႅပ်ႈမၼ်းလႆႈယူႇ။

Engvar

No description.

Template parameters[ၸတ်းၵၢၼ် ၶေႃႈမုၼ်းထႅမ်းပလဵၵ်ႉ]

Parameterၶေႃႈသပ်းလႅင်းTypeStatus
defaultworddefaultword

no description

Unknownoptional
engvarengvar

no description

Unknownoptional
word as spelled in language code en-XXen-XX

no description

Unknownoptional

ၽိူမ်ႉတူၺ်း

[မႄးထတ်းငဝ်ႈငႃႇ]