跳转到内容

Template:Label

維基詞典,自由的多語言詞典
此模板需要說明文件。
請在說明文件頁加上適當的描述(如其目的、使用方法等)。

(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
字符串可选