• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Country prefix the/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Country prefix the
(Redirected from Template:CountryPrefixThe/sandbox)
This is the template sandbox page for Template:Country prefix the (diff).
Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 133,000 pages.
To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them.

This is a helper template, use by other templates.

Takes a country name, and 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.

Contents

  • 1 Usage
    • 1.1 Examples
      • 1.1.1 Only "the"
  • 2 Full parameter list
  • 3 TemplateData
  • 4 Tracking categories
  • 5 See also

Usage

edit

{{Country prefix the|Countryname}}

{{Country prefix the|Countryname|onlythe=yes}}

{{Country prefix the|Countryname|onlythe=yes}}

{{Country prefix the|Countryname|capitalised=yes}}

{{Country prefix the|Countryname|capitalised=yes|onlythe=yes}}

Examples

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

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

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

Only "the"

edit

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 {{Country prefix the}}, then the word the is incorrectly part of the linked text

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

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

Full parameter list

edit

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 = 
}}

TemplateData

edit
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Country prefix the in articles based on its TemplateData.

TemplateData for Country prefix the

This template takes a country name, and returns the name prefixed by 'the' if that is required in running text. Otherwise just returns the country name.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Input value1

The value to be evaluated

Stringrequired
Output only the word 'the'onlythe

Outputs only the word 'the' when the input value is a case-insensitive forms of 'Yes', 'Y', 'True' or '1'

Stringoptional
Capitalise 'the'?capitalised capitalized

Capitalises the word 'the' as 'The' when the input value is a case-insensitive forms of 'Yes', 'Y', 'True' or '1'

Default
false
Booleanoptional

Tracking categories

edit
  • Category:Template Year in country category with prefix available though CountryPrefixThe (7,934)
  • Category:Template Year in country category with prefix parameter matching that in CountryPrefixThe (7,402)
  • Category:Template Year in country category with prefix parameter NOT matching that in CountryPrefixThe (119)

See also

edit
  • {{#invoke:ustring|gsub}} can be used to strip the "the" :
    • {{#invoke:ustring|gsub|the United Kingdom|^the ?|}} → United Kingdom
    • {{#invoke:ustring|gsub|France|^the ?|}} → France
  • Module:CountryAdjectiveDemonym
The above documentation is transcluded from Template:Country prefix the/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Country_prefix_the/sandbox&oldid=1233825974"
Last edited on 11 July 2024, at 02:46

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 11 July 2024, at 02:46 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop