Модул:лабелс/дата/док
Ово је документациона подстраница за Модул:labels/data
This module is one of the data modules specifying the labels recognized by Module:labels and, by extension, the templates {{lb}}
and {{tlb}}
.
The following are all the data submodules that exist:
Module | Contents |
---|---|
Module:labels/data/lang/<var>langcode</var> |
Language-specific labels. |
Module:labels/data | Miscellaneous non-language-specific labels. |
Module:labels/data/qualifiers | Qualifiers such as somewhat , also , chiefly and ; . Usually these cause the following and/or preceding comma to be omitted.
|
Module:labels/data/regional | Labels specifying a geographic location that is shared among several languages. |
Module:labels/data/topical | Topical labels such as anthropology and Taoism . These typically generate topic categories.
|
Labels defined in earlier-listed modules override those in later-listed modules. In particular, language-specific labels override non-language-specific ones. The full list of language-specific submodules can be found here.
Each language data module exports a single table containing labels and/or aliases. The keys of these tables are label identifiers (passed to the templates), while the values are described below.
Label usages
уредиLabel data is currently used for several purposes:
Template(s) | Parameter(s) | Purpose | Categorizes? |
---|---|---|---|
{{lb}} /{{lbl}} /{{label}} and {{tlb}} /{{term-label}} |
|2= , |3= , ... |
Label the language variety or usage conditions of a sense or term. | Yes |
{{alt}} /{{alter}} |
numbered parameters following a blank parameter | Identify the language variety or usage conditions of an alternative form. | No |
{{alternative form of}} /{{alt form}} , {{standard spelling of}} /{{stand sp}} , and other form-of templates |
|from= , |from2= , ... |
Identify the language variety of a sense or term that is a variant (e.g. alternative form, spelling variant, etc.) of another term. | Yes |
{{syn}} , {{ant}} and other "nyms" templates |
|lb= , |lb2= , ...; the <lb:...> inline modifier |
Identify the language variety or usage conditions of a synonym, antonym or the like, specified inline. | No |
{{desc}} /{{descendant}} |
|lb= , |lb2= , ...; the <lb:...> inline modifier |
Identify the language variety or usage conditions of a descendant. | No |
{{quote-book}} , {{quote-journal}} , {{cite-book}} , {{cite-journal}} and other quotation and citation templates |
|lb= |
Identify the language variety or usage conditions of a piece of quoted text. | No |
{{inflection of}} /{{infl of}} |
auto-added under certain combinations of inflection tags | Label the usage conditions of an inflected form of a term. | Yes |
{{indtr}} |
|2= , |3= , ... following a period/full stop |
Label the usage conditions of a sense or term, along with the syntactic form taken by a direct or indirect object. | Yes |
category pages for language varieties | N/A | Control the display and parent categories of category pages that are "associated" with a label in that the label categorizes into the specified category using the plain_categories or regional_categories fields. |
N/A |
Label data modules
уреди{{label data documentation}}
.[edit]
Each data module defines and exports a table called labels
containing the data associated with the actual labels. The key is the label while the value is a table containing information on the label. The following is a basic example:
labels["Argentina"] = { aliases = {"Argentinian"}, Wikipedia = true, regional_categories = "Argentinian", }
This defines a label Argentina
with an alias Argentinian
, links the label to the Wikipedia article Argentina, and causes uses of the label with {{lb}}
or {{tlb}}
to categorize into Argentinian <var>lang</var>
where <var>lang</var>
is the language of the label.
The following is a more complex example, for use in Module:labels/data/lang/en:
labels["British"] = { region = "Great Britain", addl = "Not to be confused with [[:Category:British English forms|British spellings]], a spelling system used in some English-speaking countries of the world.", aliases = {"Britain", "Great Britain"}, Wikipedia = "British English", regional_categories = true, parent = "Europe,Commonwealth", country = "the United Kingdom", }
This defines a label British
with two aliases Britain
and Great Britain
, all of which display as British
and link to the Wikipedia article British English. Use with {{lb}}
or {{tlb}}
categorize into British English. The fields region
, addl
, parent
and country
control the appearance of the category text for the category British English.
The following table specifies the basic fields. See the documentation of Module:labels/data for more detailed information.
Field | Example | Description |
---|---|---|
aliases |
{"Britain", "Great Britain" } |
List of aliases for the label. |
display |
"Taraškievica orthography" or "[[alcoholic#Adjective|alcoholic]] [[beverage]]s" |
How the label displays (if different from the label itself). |
Wikipedia |
"Shopi#Dialects" or true or {"Goan Portuguese", "Portuguese India" } |
Wikipedia article to link to, or true if the article is named the same as the (canonical form of the) label. Multiple articles can be provided; only the first is used for linking the label, but all are displayed on the label's category page.
|
Wiktionary |
"Appendix:Swedish verbs" |
Wiktionary article to link to, or true if the anchor is named the same as the (canonical form of the) label.
|
Wikidata |
"Q2675834" or {"Q98095139", "Q9668261" } |
Wikidata ID or ID's identifying one or more Wikipedia articles to link to. Multiple ID's can be provided; only the first associated article is used for linking the label, but all are displayed on the label's category page. |
glossary |
"tashif" |
The anchor in Appendix:Glossary to link to, or true if the anchor is named the same as the (canonical form of the) label.
|
langs |
{"la", "lad", "nrf", "vi", "yi" } |
Language restriction for this label, for labels not occurring in a language-specific module. The label will only be recognized for the specified language code(s). |
The following table specifies the fields used to control how the label categorizes when used with {{lb}}
or {{tlb}}
.
Field | Example | Description |
---|---|---|
plain_categories |
"Multicultural Toronto English" or true or {"American English forms", "Oxford spellings" } |
Category or categories to add the page to, when {{lb}} or {{tlb}} are used; use true if the category is the same as the (canonical form of the) label.
|
regional_categories |
"Algerian" or true or {"Devonian", "Somerset" } |
Like plain_categories but the language name is appended to the specified value(s).
|
pos_categories |
"pluralia tantum" or true or {"transitive verbs", "intransitive verbs" } |
Like plain_categories but the language name is prepended to the specified value(s).
|
topical_categories |
"Football (American)" or true or {"Software engineering", "Programming" } |
Like plain_categories but the language code is prepended to the capitalized specified value(s).
|
sense_categories |
"dated" or true or {"obsolete", "historical" } |
Categorizes into <var>lang</var> terms with <var>category</var> senses (when using {{lb}} ) or {{lang category terms}} (when using {{tlb}} ).
|
The following table specifies the fields used to control the appearance of the category page (specified using plain_categories
or regional_categories
) for labels that specify language varieties.
Field | Example | Description |
---|---|---|
region |
"the [[United States]]" or "the tri-state region of <country>" or "[[Cajun]]s in {{w|Acadiana|Southern Louisiana}}" |
Region where the variety specified by the label is used; or the users of the variety, if prep = "by" is given. Defaults to the label. The spec <country> is replaced by the value(s) specified using the country field; see below.
|
the |
true |
Causes the default value for region to have the word the prepended (e.g. for a label such as Philippines or Channel Islands ).
|
prep |
"by" |
Preposition used in the category description, after Terms or senses in lang as spoken, in place of in.
|
verb |
"originally spoken" or "used" |
Verb used in the category description, after Terms or senses in lang as, in place of spoken.
|
def |
"[[Lunfardo]], a Spanish [[argot]] with origins in [[Buenos Aires]]" |
Definition text used in the category description, after Terms or senses in. Defaults to <var>lang</var> as spoken in <var>region</var> , where <var>lang</var> is the language and <var>region</var> is the value of the region field.
|
fulldef |
"Anglo-Indian terms or senses in English as used formerly by Britishers in {{w|British India}}" |
Definition text used in the category description. Defaults to Terms or senses in <var>lang</var> as spoken in <var>region</var> ; see the def field.
|
addl |
"Not to be confused with the {{catlink|Bavarian language}}." |
Additional text to display on the label's category page. |
parent |
"New England" or true or "Southern US,Southwestern US" |
Parent label(s). The category corresponding to the label will have the category or categories of the parent label(s) as its parent(s). If true , the parent will be Regional <var>lang</var> , or Varieties of <var>lang</var> if noreg = true is given.
|
noreg |
true |
Specify that this variety is non-regional (not a topolect). Used e.g. with chronolects such as Early Modern English and sociolects such as Katharevousa. Controls the default parent when parent = true is used.
|
othercat |
"en:Universities" or "British slang,English cant,English gay slang" |
Additional category or categories to add the label's category page to. Useful especially for categories not associated with a label. |
country |
"France" or "Belgium,the [[Netherlands]],Germany" |
Country or countries where this label's variety is spoken. Used in two ways: (1) to add the label's category to pages such as Category:Languages of France or Category:Languages of the Netherlands; (2) to substitute into the <country> spec in the description.
|
The following table specifies the remaining fields, used mostly to control how the label displays.
Field | Example | Description |
---|---|---|
deprecated |
true |
Indicate that this label is deprecated (should not be used). Such labels display with the deprecated-label CSS class and cause the page to be added to Category:Entries with deprecated labels.
|
deprecated_aliases |
{"dual" } |
Specify deprecated aliases of the given label (i.e. aliases that should not be used). Usage of such aliases causes the label to display with the deprecated-label CSS class and the page to be added to Category:Entries with deprecated labels.
|
track |
true |
Track all usages of this label (including any aliases) at a page named Wiktionary:Tracking/labels/label/<var>label</var> where <var>label</var> is the canonical label (click on "See whether another page links to [this page]"), and also at a page named Wiktionary:Tracking/labels/label/<var>label</var>/<var>code</var> , where <var>code</var> is the language code specified in |1= .
|
special_display |
[[Classical <canonical_name>]] |
Like display but <canonical_name> is replaced with the canonical language name.
|
omit_preComma |
true |
Don't display a comma before the label, for labels like and , by , _ and ; .
|
omit_postComma |
true |
Don't display a comma after the label, for labels like and , by , _ , ; and chiefly .
|
omit_preSpace |
true |
Don't display a space before the label, for labels like ; and : .
|
omit_postSpace |
true |
Don't display a comma after the label, for labels like - (hyphen), – (en-dash) and — (em-dash).
|
At the end of the data module, the labels
table should be returned using the following code:
return require("Module:labels").finalize_data(labels)