ទំព័រគំរូ:context/doc

ពីWiktionary

Usage[កែប្រែ]

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

A label is placed before the definition, such as:

# {{context|AU|slang}} An [[insidious]] person.
  1. Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "AU" is not valid.. 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}} and {{context|maths}} both produce the same result, expanding to Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "mathematics" is not valid... (Technically, this is because the templates {{math}} and {{maths}} redirect.)

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.

Some examples to demonstrate the range of current functionality:

  • A single ad hoc context with no supporting template:
    • {{context|foobarbazbip}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "foobarbazbip" is not valid..
  • A single context with supporting template (for categorization and custom label-text):
  • Multiple contexts (up to about nine), with or without supporting templates:
    • {{context|foobar|bazbip}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "foobar" is not valid..
    • {{context|Australia|slang}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "Australia" is not valid..
    • {{Australia|slang}}ទំព័រគំរូ:Australia
    • {{context|foobar|slang}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "foobar" is not valid..
    • {{context|Australia|foobar|bazbip}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "Australia" is not valid..
    • {{Australia|foobar|bazbip}}ទំព័រគំរូ:Australia
  • Multiple contexts, with special built-in separator pseudo-contexts that replace the comma:
    • {{context|foobar|,|bazbip}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "foobar" is not valid..
    • {{context|foobar|_|bazbip}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "foobar" is not valid..
    • {{context|foobar|_|bazbip|slang}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "foobar" is not valid..
    • {{context|foobar|or|bazbip}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "foobar" is not valid..
    • {{context|foobar|and|bazbip}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "foobar" is not valid..
    • {{context|foobar|and|bazbip|or|Australia}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "foobar" is not valid..
    • {{context|Australia|or|foobar}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "Australia" is not valid..
    • {{Australia|or|foobar}}ទំព័រគំរូ:Australia
  • Qualifier/modifier pseudo-contexts whose supporting templates suppress following comma (by adding a _ parameter):
    • {{context|chiefly|foobar}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "chiefly" is not valid..
    • {{chiefly|foobar}}ទំព័រគំរូ:chiefly
    • {{context|of a|person}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "of a" is not valid..
    • {{of a|person}}
  • If you're wondering what happens when a separator pseudo-context is first, last, or adjacent to another one:
    • {{context|,}}     {{context|,|a}}     {{context|a|,}}     →     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "," is not valid..     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "," is not valid..     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..
    • {{context|_}}     {{context|_|a}}     {{context|a|_}}     →     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "_" is not valid..     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "_" is not valid..     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..
    • {{context|or}}     {{context|or|a}}     {{context|a|or}}     →     Lua error in Module:labels at line 177: You must specify at least one label..     (a)     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..
    • {{context|and}}     {{context|and|a}}     {{context|a|and}}     →     Lua error in Module:labels at line 177: You must specify at least one label..     (a)     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..
    • {{context|a|,|,|b}}     {{context|a|,|_|b}}     {{context|a|,|or|b}}     →     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..
    • {{context|a|_|,|b}}     {{context|a|_|_|b}}     {{context|a|_|or|b}}     →     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..
    • {{context|a|and|,|b}}     {{context|a|and|_|b}}     {{context|a|and|or|b}}     →     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "a" is not valid..
    • Special cases with _:
  • If you're wondering what happens when there are no parameters, or when there are blank/missing parameters:
    • {{context}}     {{context|}}     →     Lua error in Module:labels/templates at line 48: Language code has not been specified. Please provide it to the template using the first parameter..     Lua error in Module:labels/templates at line 48: Language code has not been specified. Please provide it to the template using the first parameter..
    • {{context|asdfghjk||}}Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "asdfghjk" is not valid..
    • {{context||asdfghjk}}     {{context|2=asdfghjk}}     →     Lua error in Module:labels/templates at line 48: Language code has not been specified. Please provide it to the template using the first parameter..     Lua error in Module:labels/templates at line 48: Language code has not been specified. Please provide it to the template using the first parameter..
    • {{context|asdf||ghjk}}     {{context|asdf|3=ghjk}}     →     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "asdf" is not valid..     Lua error in Module:labels/templates at line 52: Please enter a language code in the first parameter. The value "asdf" is not valid..