Template:context

(example)


The following documentation is located at Template:context/documentation. [edit]


Use this template, as described in Wiktionary:Context labels:

  1. To label senses with restricted usage
  2. To label senses with grammatical information, in addition to that in the part-of-speech heading and headword line

This template uses Module:labels as a back-end. A list of all recognised labels can be found at Module:labels/data.

Usage

A label is placed before the definition, such as:

# {{context|AU|slang|lang=en}} An [[insidious]] person.
  1. (Australia, slang) An insidious person.

This template provides consistency. The same visual result could be achieved with simpler formatting; however, context helps to ensure that the same labels are used across the project. For instance, {{context|math|lang=en}} and {{context|maths|lang=en}} both produce the same result, expanding to (mathematics).

Use of a context label also provides automatic categorization. For instance, the example above is categorized as Australian English and Slang. Likewise, any page with a context of math or maths will be automatically placed in category Mathematics. However, these templates should not be used merely for categorization. It is still preferable to list a [[Category: ]] when there is no specific context for a term.

Regions are meant to indicate where a term is used, not to specify location of an entity. For instance, the Sphinx in Giza should not be labeled Egypt. Rather, that's part of the definition. Also note that time and space are not contexts. The word “week” is understood to mean seven days whether one is discussing war or widgets or the weather, in speech or song or storybook.

Examples

Some examples to demonstrate the range of current functionality:

  • A single ad hoc context with no supporting template:
    • {{context|foobarbazbip|lang=en}}(foobarbazbip)
  • A single context with supporting template (for categorization and custom label-text):
    • {{context|Australia|lang=en}}(Australia)
  • Multiple contexts (up to about nine), with or without supporting templates:
    • {{context|foobar|bazbip|lang=en}}(foobar, bazbip)
    • {{context|Australia|slang|lang=en}}(Australia, slang)
    • {{context|foobar|slang|lang=en}}(foobar, slang)
    • {{context|Australia|foobar|bazbip|lang=en}}(Australia, foobar, bazbip)
  • Multiple contexts, with special built-in separator pseudo-contexts that replace the comma:
    • {{context|foobar|,|bazbip|lang=en}}(foobar, ,, bazbip)
    • {{context|foobar|_|bazbip|lang=en}}(foobar bazbip)
    • {{context|foobar|_|bazbip|slang|lang=en}}(foobar bazbip, slang)
    • {{context|foobar|or|bazbip|lang=en}}(foobar or bazbip)
    • {{context|foobar|and|bazbip|lang=en}}(foobar and bazbip)
    • {{context|foobar|and|bazbip|or|Australia|lang=en}}(foobar and bazbip or Australia)
    • {{context|Australia|or|foobar|lang=en}}(Australia or foobar)
  • Qualifier/modifier pseudo-contexts whose supporting templates suppress following comma (by adding a _ parameter):
    • {{context|chiefly|foobar|lang=en}}(chiefly foobar)
    • {{context|of a|person|lang=en}}(of a person)
  • If you're wondering what happens when a separator pseudo-context is first, last, or adjacent to another one:
    • {{context|,|lang=en}}     {{context|,|a|lang=en}}     {{context|a|,|lang=en}}     →     (,)     (,, a)     (a, ,)
    • {{context|_|lang=en}}     {{context|_|a|lang=en}}     {{context|a|_|lang=en}}     →     ()     ( a)     (a )
    • {{context|or|lang=en}}     {{context|or|a|lang=en}}     {{context|a|or|lang=en}}     →     (or)     (or a)     (a or)
    • {{context|and|lang=en}}     {{context|and|a|lang=en}}     {{context|a|and|lang=en}}     →     (and)     (and a)     (a and)
    • {{context|a|,|,|b|lang=en}}     {{context|a|,|_|b|lang=en}}     {{context|a|,|or|b|lang=en}}     →     (a, ,, ,, b)     (a, , b)     (a, , or b)
    • {{context|a|_|,|b|lang=en}}     {{context|a|_|_|b|lang=en}}     {{context|a|_|or|b|lang=en}}     →     (a ,, b)     (a b)     (a or b)
    • {{context|a|and|,|b|lang=en}}     {{context|a|and|_|b|lang=en}}     {{context|a|and|or|b|lang=en}}     →     (a and ,, b)     (a and b)     (a and or b)
    • Special cases with _:
      • {{context|chiefly|lang=en}}(chiefly)
      • {{context|of a|or|about a|lang=en}}(of a or about a)

See also

Last modified on 8 April 2014, at 13:36