Jump to content
Wikipedia The Free Encyclopedia

Module:Engvar/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
(15 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{(削除) in (削除ここまで)use}}
{{(追記) High- (追記ここまで)use}}
{{Lua|Module:Engvar/detect|Module:Arguments|Module:Yesno|noprotcat=yes}}
This module is allows a template to show '''national variants of English''' ([[WP:ENGVAR]]) in templates, depending on the individual article preference. See also {{tl|Engvar}}.
This module implements {{t|engvar}}. {{#section:Template:Engvar/doc|ledeMinusLeadSentence}}

For example, a single template can show "football" text in en-UK articles, and "soccer" in en-US articles.

== Usage ==
See {{tl|Engvar}}.

<pre>
| defaultWord =
| engvar = {{{engvar|}}}
| defaultLang =
| en-XX = <!-- Add country code for XX, and the nation language word -->
| en-YY = <!-- Add more variants as might be needed -->
| engvarCat = {{{engvarCat|}}}
| engvarCatSort =
</pre>

;{{para|engvar}}
This input (user input) is checked against a list of possible words ("en-US, American English, United States"). Internal identifier is the code like "en-US".

;{{para|engvarCatSort}}
Sort text for maintenance category. Advise to set to project name like "rainbow" not "infobox rainbow" (all templates will fill this category!). Default is pagename.

;Maintenance category:
*[[:Category:Articles using an unknown Template:Engvar option]]


==Parameter list==
==Parameter list==
{{#section-h:Template:Engvar/doc|Parameter list}}
In the
<pre>
| 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|}}} <!-- yes/no; '=no' will suppress message category in article page) -->
</pre>


==Maintenance category==
In the parameter list, for the editor to see & use:
{{#section-h:Template:Engvar/doc|Maintenance category}}
<pre>
| engvar =
| engvarCat =
</pre>


==List of (削除) variant (削除ここまで) (削除) languages (削除ここまで)==
==List of (追記) English (追記ここまで) (追記) varieties (追記ここまで)==
{{#section-h:Template:Engvar/doc|List of English varieties}}
In the ''template code'' {engvar module & template), only use the ISO-code as parameter name. The article editor can use the descriptive words too ({{para|engvar|Hong Kong English}} will show the {{para|en-HK}} variant word).
{{para|en-UK|vapour}}


==See also==
{| class="wikitable sortable collapsible uncollapsed" style="min-width:50%;"
{{#section-h:Template:Engvar/doc|See also}}
! 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-SCOTLAND
|-
| [[Singapore English]]
| en-SG
|-
| [[South African English]]
| en-ZA
|-
| [[Trinidadian English]]
| en-TT
|-
| {{hidden sort key|_Oxford}}British English [[Oxford spelling]]<br/>British (Oxford) English<br/>''[[Oxford English Dictionary]]'' (OED)
| {{hidden sort key|_Oxford}}en-EOD
|-
| {{hidden sort key|_IUPAC}}IUPAC spelling
| {{hidden sort key|_IUPAC}}en-IUPAC
|-
| {{hidden sort key|_IUPAC-US}}IUPAC spelling US
| {{hidden sort key|_Oxford}}en-IUPAC
|}
*[[HELP:ENGVAR]]
*[[:Category:Articles using an unknown Template:Engvar option]]
*[[ISO 3166-1 alpha-2]] 2-letter country code


<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- Categories go here and interwikis go in Wikidata. -->
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Varieties of English templates|*, {{PAGENAME}}]]


}}</includeonly>
}}</includeonly(追記) ><noinclude (追記ここまで)>
[[Category:Module documentation pages]]
</noinclude>

Latest revision as of 21:14, 29 August 2024

Warning 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

[edit ]

Template

[edit ]
{{#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

[edit ]
{{example
| engvar =
| engvarCat =
}}

Maintenance category

[edit ]

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".

List of English varieties

[edit ]

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

[edit ]

AltStyle によって変換されたページ (->オリジナル) /