Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WiktionaryThe Free Dictionary
Search

Template:label

From Wiktionary, the free dictionary

(example)


The followingdocumentation is located atTemplate:label/documentation.[edit]
Useful links:subpage listlinksredirectstransclusionserrors (parser/module) •sandbox (diff)
Shortcuts:
{{lb}}
{{lbl}}
Lua logo

This template generates a context label. It is to be used, as described inWiktionary: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 generates content usingModule:labels/templates andModule:labels. Lists of all recognised labels can be found in the following modules:

To search for a label in these data modules, search on this page starting at#Defined labels or use the search box on the right. To add a label, go to the appropriate data module and follow the directions in the documentation page, or ask someone else to add the label atModule talk:labels/data.

Usage

A label is placed before the definition, as in this example:

#{{lb|en|AU|colloquial|pejorative}} An[[insidious]] person.

…which generates:

  1. (Australia, colloquial, derogatory) Aninsidious person.

{{lb}},{{lbl}}, and{{label}} are all equivalent.{{lb}} is preferred for conciseness.

The first parameter is thelanguage code of the section in which the template is placed (e.g.en for English); seeWT:LANGLIST for the full list. Further parameters are labels, most of which indicate usage context, or label modifiers.

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

Use of a context label also provides automatic categorization. For instance, the example above is categorized asAustralian English andslang. Likewise, any page with a context ofmath ormaths will be automatically placed in categoryMathematics. 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, theSphinx in Giza should not be labeledEgypt. Rather, that's part of the definition. Also,time andspace 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.

{{lb}} is not meant to be used after a headword line. If a context label applies to all senses in a headword, the label can be placed after the headword template with{{tlb}} or{{term-label}}.

Examples

Some examples to demonstrate the range of current functionality:

  • A singlead 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

An example of a language-specific label:

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

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

Redirecting labels

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}}(Greekmythology)
{{label|grc|Greek god}}(Greekmythology)
{{label|de|Greek god}}(Greekmythology)

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

Complex cases involving multiple contexts, especially those that involve pseudo-contexts, are often easier to format usingdouble 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 nowrare anddated; andAfrican-American Vernacular, where it is still sometimes used)

Comma-separated arguments inside of double angle brackets are split if the comma isnot 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 traditionalNew York City)
{{label|en|<<UK>>, <<Australia>>, <<NZ>> or traditional <<NYC>>}}(UK,Australia,New Zealand or traditionalNew 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 traditionalNew York City)

Suppressing canonicalization of labels

Labels are normally converted to their canonical forms, for consistency. For example,Australian automatically displays asAustralia rather thanAustralian. 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)
{{label|en|Arab <<!Australian>>}}(ArabAustralian)

Forcing a label to display a particular way

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 andMidland US)
{{label|en|Southern US!Southern|and|Midland US}}(Southern and Midland US)

Additional parameters

|sort=
Sortkey. Usually can be generated automatically from the page name.
|nocat=1
Don't add categories.

Determining where a label is being used

Automatic tracking is in place for all labels. To determine where a label is being used, visit the pageSpecial:WhatLinksHere/WT:Tracking/labels/label/label wherelabel is the label in question. For example, to determine where the labelNew Zealand is being used, go toSpecial:WhatLinksHere/WT:Tracking/labels/label/New Zealand, and to determine where the labelskateboarding is used, go toSpecial:WhatLinksHere/WT:Tracking/labels/label/skateboarding. Note that tracking is disabled for a small number of very large pages that tend to hit processing timeouts, in order to reduce the total time spent processing such pages. Examples area,de,и and; these pages won't show up in the tracking lists even if they use the label in question. To see the list of pages for which tracking is disabled, go toModule:labels and look forpages_where_tracking_is_disabled (near the top of the module).

See also

Other templates that make use of the same context labels:

TemplateData

This is theTemplateData documentation for this template used byVisualEditor and other tools.

TemplateData for label

Use this template to label senses with restricted usage or grammatical information, in addition to that in the part-of-speech heading and headword line

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
language1

The language of the current section

Example
en
Stringrequired
usage context2

Context of usage, such as language register or domain/field

Example
slang
Stringrequired
location 13

Region (location in the world) where the term is (or was) restricted, or mostly employed (first value)

Example
Australia
Stringoptional
location 24

Region (location in the world) where the term is (or was) restricted, or mostly employed (second value)

Example
UK
Stringoptional
categorizationnocat

disables categorization when set to any value

Example
1
Booleanoptional


Defined labels

SeeTemplate:label/list (warning: very large page).


Retrieved from "https://en.wiktionary.org/w/index.php?title=Template:label&oldid=81059628"
Categories:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp