模板:Label
(example)
![]() | 使用Lua语言编写: |
Use this template, as described in Wiktionary:Context labels:
- To label senses with restricted usage
- 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:
- Module:labels/data
- Module:labels/data/regional
- Module:labels/data/topical
- Module:labels/data/qualifiers
- Module:labels/data/lang/en (for English-specific labels)
- Module:labels/data/lang/grc (for Ancient-Greek-specific labels)
- Module:labels/data/lang/yo (for Yoruba-specific labels)
- ... (for about 250 languages currently)
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}} 指[[陰險]]之人。
{{lb}}
、{{lbl}}
和{{label}}
功能相同,{{lb}}
因简洁而为首选。
第一个参数为模板所在章节的语言代码(如en
代表英语),完整列表参见WT:LANGLIST。后续参数为上下文、主题标签。
此模板确保一致性。虽可手动达成相同视觉效果,但lb
能统一全站标签使用。例如{{lb|en|math}}
与{{lb|en|maths}}
皆显示为(数学)。
使用上下文标签会自动分类。上例将归类至[[:Category:|澳大利亚英语|澳大利亚英语]]及英语俚语。同理,含math
或maths
标签的页面会自动归入数学分类。但请勿仅为分类使用此模板,无特定上下文时仍应直接使用[[Category: ]]
。
地区标签应标示词语使用地域,而非实体所在地。例如斯芬克斯(狮身人面像)不应标注“埃及”,此属定义范畴。时空因素亦非上下文——无论讨论战争、工具(widget)或天气,在口语、歌曲或故事中,“周”皆指七日。
举例
当前功能范围示例:
- 无支持模板的单一临时上下文:
- 带有支持模板(用于分类和自定义标签文字)的单一上下文:
- 多个上下文(含/不含支援模板):
- 多个上下文,使用特殊内建分隔符伪上下文(取代逗号):
- 修饰语伪上下文(其支持模板通过添加
_
参数来抑制后续逗号):
语言专用标签
语言专用标签示例:
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.
参见
{{term-label}}
or{{tlb}}
{{qualifier}}
{{sense}}
{{gloss}}
Other templates that make use of the same context labels:
{{alt}}
or{{alter}}
: after two vertical bars{{alternative form of}}
,{{standard spelling of}}
, etc.: in the|from=
parameter{{syn}}
,{{ant}}
, and other "nyms" templates: in the|lb=
,|lb2=
, etc. parameters and the<lb:...>
inline modifier{{quote-book}}
,{{quote-journal}}
and other quote templates: in the|lb=
parameter{{desc}}
or{{descendant}}
: in the|lb=
,|lb2=
, etc. parameters and the<lb:...>
inline modifier
模板数据
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
参数 | 描述 | 类型 | 状态 | |
---|---|---|---|---|
language | 1 | The language of the current section
| 字符串 | 必需 |
label 1 | 2 | first label
| 字符串 | 必需 |
label 2 | 3 | second label
| 字符串 | 可选 |
label 3 | 4 | third label
| 字符串 | 可选 |