此模板需要说明文件。
请在说明文件页加上适当的描述(如其目的、使用方法等)。

(example)


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 generates content using Module:labels/templates and Module: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 at Module talk:labels/data.

用法

标签应置于定义之前,例如:

# {{lb|en|AU|colloquial|pejorative}} 指[[陰險]]之人。

  1. (澳大利亚口语贬义)阴险之人。

{{lb}}{{lbl}}{{label}}功能相同,{{lb}}因简洁而为首选。

第一个参数为模板所在章节的语言代码(如en代表英语),完整列表参见WT:LANGLIST。后续参数为上下文、主题标签。

此模板确保一致性。虽可手动达成相同视觉效果,但lb能统一全站标签使用。例如{{lb|en|math}}{{lb|en|maths}}皆显示为(数学)

使用上下文标签会自动分类。上例将归类至[[:Category:|澳大利亚英语|澳大利亚英语]]及英语俚语。同理,含mathmaths标签的页面会自动归入数学分类。但请勿仅为分类使用此模板,无特定上下文时仍应直接使用[[Category: ]]

地区标签应标示词语使用地域,而非实体所在地。例如斯芬克斯(狮身人面像)不应标注“埃及”,此属定义范畴。时空因素亦非上下文——无论讨论战争、工具(widget)或天气,在口语、歌曲或故事中,“”皆指七日。

举例

当前功能范围示例:

  • 无支持模板的单一临时上下文:

Template:Label/example

  • 带有支持模板(用于分类和自定义标签文字)的单一上下文:

Template:Label/example

  • 多个上下文(含/不含支援模板):

Template:Label/example

  • 多个上下文,使用特殊内建分隔符伪上下文(取代逗号):

Template:Label/example

  • 修饰语伪上下文(其支持模板通过添加_参数来抑制后续逗号):

Template:Label/example

语言专用标签

语言专用标签示例: Template:Label/example 仅当语言代码为grc(代表古希腊语)时,标签才会显示连结。

重定向标签

某些标签是“重定向”至其他标签的别名,或以其形式显示。 Template:Label/example

若使用错误的语言代码(此处为"de"(德语)),标签将不会重定向。 Template:Label/example

双尖括号表示法

涉及多个上下文的复杂案例(特别是包含伪上下文的案例),使用“双尖括号表示法”通常更易格式化。以下示例先展示伪上下文用法,再展示等效的双尖括号用法: Template:Label/example 双尖括号内以逗号分隔的参数,若逗号后无空格则会被拆分。亦可混合使用常规参数与双尖括号参数。例如以下示例均等效: Template:Label/example

抑制标签标准化

标签通常会转换为标准形式以保持一致性。例如Australian会自动显示为“Australia”而非“Australian”。但在某些情况下此行为不适用,可通过在标签前添加感叹号(!)来抑制。例如: Template:Label/example

强制标签显示特定内容

延伸前述表示法,label!display可让label显示为display而非预设内容。此功能在常规和双尖括号表示法中均适用,例如: Template:Label/example

额外参数

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

参见

Other templates that make use of the same context labels:

模板数据

这是用于新版可视化编辑器和其他工具的模板数据说明文件。

来自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

模板参数[编辑模板数据]

参数描述类型状态
language1

The language of the current section

示例值
en
字符串必需
label 12

first label

示例值
slang
字符串必需
label 23

second label

示例值
Australia
字符串可选
label 34

third label

示例值
UK
字符串可选