Jump to content

User:Benwing2/test-labels-demo

From Wiktionary, the free dictionary

Examples

[edit]

Some examples to demonstrate the range of current functionality:

  • A single ad hoc context with no supporting template:
{{label|en|foobarbazbip}} (foobarbazbip)
  • A single context with supporting template (for categorization and custom label-text):
{{label|en|Australia}} (Australia)
{{label|en|transitive}} (transitive)
  • Multiple contexts, with or without supporting templates:
{{label|en|foobar|bazbip}} (foobar, bazbip)
{{label|en|Australia|slang}} (Australia, slang)
{{label|en|foobar|slang}} (foobar, slang)
{{label|en|Australia|foobar|bazbip}} (Australia, foobar, bazbip)
  • Multiple contexts, with special built-in separator pseudo-contexts that replace the comma:
{{label|en|foobar|_|bazbip}} (foobar bazbip)
{{label|en|foobar|_|bazbip|slang}} (foobar bazbip, slang)
{{label|en|foobar|or|bazbip}} (foobar or bazbip)
{{label|en|foobar|and|bazbip}} (foobar and bazbip)
{{label|en|foobar|and|bazbip|or|Australia}} (foobar and bazbip or Australia)
{{label|en|Australia|or|foobar}} (Australia or foobar)
{{label|en|Australia|_|foobar|;|British|_|bazbip}} (Australia foobar; British bazbip)
  • Qualifier/modifier pseudo-contexts whose supporting templates suppress following comma (by adding a _ parameter):
{{label|en|chiefly|foobar}} (chiefly foobar)
{{label|en|of a|person}} (of a person)

Language-specific labels

[edit]

An example of a language-specific label:

{{label|grc|Attic}} (Attic)
{{label|en|Attic}} (Attic)

The label is only linked when the language code is grc (representing Ancient Greek).

Redirecting labels

[edit]

Certain labels are aliases that "redirect" to other labels, or are displayed as them.

{{label|en|African-American Vernacular English}} (African-American Vernacular)
{{label|en|AAVE}} (African-American Vernacular)
{{label|grc|Greek mythology}} (Greek mythology)
{{label|grc|Greek god}} (Greek mythology)
{{label|de|Greek god}} (Greek mythology)

If the wrong language code is used, in this case "de" (German), the label will not be redirected.

{{label|de|African-American Vernacular English}} (African-American Vernacular English)
{{label|de|AAVE}} (AAVE)

Double angle bracket notation

[edit]

Complex cases involving multiple contexts, especially those that involve pseudo-contexts, are often easier to format using double angle bracket notation. The following shows an example, first using pseudo-contexts and then the equivalent using double angle brackets:

{{label|en|Southern US|where it is|_|now|rare|and|dated|;|and|AAVE|where it is still sometimes used}} (Southern US, where it is now rare and dated; and African-American Vernacular, where it is still sometimes used)
{{label|en|<<Southern US>>, where it is now <<rare>> and <<dated>>; and <<AAVE>>, where it is still sometimes used}} (Southern US, where it is now rare and dated; and African-American Vernacular, where it is still sometimes used)

Comma-separated arguments inside of double angle brackets are split if the comma is not followed by a space. You can also mix regular and double angle bracket arguments. For example, the following are all equivalent:

{{label|en|<<UK,Australia,NZ>> or traditional <<NYC>>}} (UK, Australia, New Zealand or traditional New York City)
{{label|en|<<UK>>, <<Australia>>, <<NZ>> or traditional <<NYC>>}} (UK, Australia, New Zealand or traditional New York City)
{{label|en|UK|Australia|NZ|or|traditional|_|NYC}} (UK, Australia, New Zealand or traditional New York City)
{{label|en|UK|Australia|NZ|or|traditional <<NYC>>}} (UK, Australia, New Zealand or traditional New York City)

Suppressing canonicalization of labels

[edit]

Labels are normally converted to their canonical forms, for consistency. For example, Australian automatically displays as Australia rather than Australian. In some circumstances, however, this is undesirable. To suppress this, precede the label with an exclamation point (!). For example:

{{label|en|Arab|_|Australian}} (Arab Australia)
{{label|en|Arab|_|!Australian}} (Arab Australian)

Forcing a label to display a particular way

[edit]

An extension of the previous notation, <var>label</var>!<var>display</var>, allows you to display <var>label</var> as <var>display</var> in place of how it would normally display. This works both in regular and double angle bracket notation, for example:

{{label|en|<<Southern US!Southern>> and <<Midland US>>}} (Southern and Midland US)
{{label|en|Southern US!Southern|and|Midland US}} (Southern and Midland US)

Notes

[edit]
  • {{indtr}} is a separate context label template used in Portuguese.