Difference between revisions of "Template:CountryPrefixThe/doc"

From blackwiki
Jump to navigation Jump to search
imported>BrownHairedGirl
(→‎Examples: Note that the alternative spelling "capitalized=yes" has the same effect)
imported>BrownHairedGirl
(full parameter list)
Line 54: Line 54:
 
The solution is to use the <code><nowiki>onlythe=yes</nowiki></code> parameter:
 
The solution is to use the <code><nowiki>onlythe=yes</nowiki></code> parameter:
 
<code><nowiki>"products were exported to {{CountryPrefixThe|{{{country}}}|onlythe=yes}} [[{{country}}]]"</nowiki></code>  → products were exported to the [[United States]]
 
<code><nowiki>"products were exported to {{CountryPrefixThe|{{{country}}}|onlythe=yes}} [[{{country}}]]"</nowiki></code>  → products were exported to the [[United States]]
 +
== Full parameter list ==
 +
Unnamed parameter 1= the input value to be evaluated. The other parameters (all named, all optional), set options. The value of the options is calculated by {{tl|Yesno}}, which interprets as "yes" case-insensitive forms of <code><nowiki>Yes</nowiki></code>, <code><nowiki>y</nowiki></code>, <code><nowiki>true</nowiki></code>, and <code><nowiki>1</nowiki></code>
 +
 +
<pre>
 +
{{yesno
 +
|
 +
| capitalised =
 +
| onlythe =
 +
}}
 +
</pre>
 +
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||
 
<!-- Categories below this line, please; interwikis at Wikidata -->
 
<!-- Categories below this line, please; interwikis at Wikidata -->

Revision as of 05:05, 20 November 2018

This is a helper template, use by other templates.

Takes a country name, a returns the name prefixed by "the" if that is required in running text. Otherwise just returns the country name.

Optionally, returns just the word "the", if applicable.

In either case, the word "the" may optionally be returned in capitalised form.

Usage

{{CountryPrefixThe|Countryname}}

{{CountryPrefixThe|Countryname|onlythe=yes}}

{{CountryPrefixThe|Countryname|onlythe=yes}}

{{CountryPrefixThe|Countryname|capitalised=yes}}

{{CountryPrefixThe|Countryname|capitalised=yes|onlythe=yes}}

Examples

No parameters
  1. {{CountryPrefixThe|Kenya}} → Kenya
  2. {{CountryPrefixThe|Philippines}} → the Philippines
with "onlythe=yes"
  1. {{CountryPrefixThe|Kenya|onlythe=yes}}
  2. {{CountryPrefixThe|Philippines|onlythe=yes}} → the
with "capitalised=yes"
  1. {{CountryPrefixThe|Kenya|capitalised=yes}} → Kenya
  2. {{CountryPrefixThe|Philippines|capitalised=yes}} → The Philippines

Note that the alternative spelling "capitalized=yes" has the same effect

with both "onlythe=yes" and "capitalised=yes"
  1. {{CountryPrefixThe|Kenya|onlythe=yes|capitalised=yes}}
  2. {{CountryPrefixThe|Philippines|onlythe=yes|capitalised=yes}} → The

Only "the"

The optional parameter "onlythe=yes" allow control of whether the countryname is included in the returned value.

There are some situations where the definite article is needed alone, e.g. when the countryname is to be linked but the word "the" should not be linked.

e.g.: products were exported to [[{{{country}}}]]

If {{{country}}}=United States, then we get a grammatically incorrect result:

products were exported to [[{{{country}}}]]" → products were exported to United States

Alternatively, if {{{country}}}=United States and we use {{CountryPrefixThe}}, then then word the is incorrectly part of the linked text

products were exported to [[{{CountryPrefixThe|{{{country}}}}}]] → products were exported to the United States

The solution is to use the onlythe=yes parameter: "products were exported to {{CountryPrefixThe|{{{country}}}|onlythe=yes}} [[{{country}}]]" → products were exported to the United States

Full parameter list

Unnamed parameter 1= the input value to be evaluated. The other parameters (all named, all optional), set options. The value of the options is calculated by {{Yesno}}, which interprets as "yes" case-insensitive forms of Yes, y, true, and 1

{{yesno
|
| capitalised =
| onlythe = 
}}