Template:Label
(example)
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
| 字符串 | 可选 |