Модул:languages/datax/док
Изглед
< Модул:languages | datax
Ово је документациона подстраница за Модул:languages/datax
This module contains definitions and metadata for language codes. See Викиречник:Језици for more information.
This module must not be used directly in other modules or templates. The data should be accessed through Модул:languages. For the corresponding extra data, see Модул:languages/datax/док/extra.
Errors
[уреди]The following errors were detected by Модул:data consistency check:
- Norwegian Bokmål језик (
nb
) has Middle Norwegian језик (gmq-mno
) set as an ancestor, but is not in the West Scandinavian family (gmq-wes
). - Norwegian Bokmål језик (
nb
) has Дански језик (da
) set as an ancestor, but is not in the East Scandinavian family (gmq-eas
).
- Southern Amami-Oshima, the canonical name for
ams
, is repeated in the table ofaliases
.
- Panyi Bai, the canonical name for
bfc
, is repeated in the table ofotherNames
. - Daakaka, the canonical name for
bpa
, is repeated in the table ofotherNames
.
- Caribbean Hindustani језик (
hns
) has Bhojpuri језик (bho
) set as an ancestor, but is not in the Eastern Indo-Aryan family (inc-eas
). - Caribbean Hindustani језик (
hns
) has Awadhi језик (awa
) set as an ancestor, but is not in the Eastern Hindi family (inc-hie
).
- Äiwoo, the canonical name for
nfl
, is repeated in the table ofotherNames
.
- Toku-No-Shima, the canonical name for
tkn
, is repeated in the table ofaliases
.
- Ura (Papua New Guinea), the canonical name for
uro
, is repeated in the table ofotherNames
.
- Wiradjuri, the canonical name for
wrh
, is repeated in the table ofotherNames
.
- Literary Chinese језик (
lzh-lit
) has a canonical name that is not unique; it is also used by the codelzh
. - The data key
preprocess_links
for ??? (th-new
) is invalid.
- Old Indo-Aryan family (
inc-old
) has no child families or languages. - Prakrit family (
pra
) has no child families or languages.
- Southern Amami Ōshima, the canonical name for the code
ams
, is wrong; it should be Southern Amami-Oshima. - The canonical name Southern Amami-Oshima (
ams
) is missing. - The canonical name Амерички знаковни језик (
ase
) is missing. - American Sign Language, the canonical name for the code
ase
, is wrong; it should be Амерички знаковни језик. - The canonical name Dhundhari (
dhd
) is missing. - Proto-West Germanic, the canonical name for the code
gmw-pro
, is wrong; it should be Пра-Западно Германски. - The canonical name Пра-Западно Германски (
gmw-pro
) is missing. - The canonical name Proto-Indo-European (
ine-pro
) is missing. - Пра-Индо-Европски, the canonical name for the code
ine-pro
, is wrong; it should be Proto-Indo-European. - Aiwoo, the canonical name for the code
nfl
, is wrong; it should be Äiwoo. - The canonical name Äiwoo (
nfl
) is missing. - Moabite, the canonical name for the code
obm
, is wrong; it should be Моавски. - The canonical name Моавски (
obm
) is missing. - Пра-Семитски, the canonical name for the code
sem-pro
, is wrong; it should be Proto-Semitic. - The canonical name Proto-Semitic (
sem-pro
) is missing. - The canonical name Кантонски (
yue
) is missing. - Cantonese, the canonical name for the code
yue
, is wrong; it should be Кантонски.
- Afar, the canonical name for the code
aa
, is wrong; it should be Афарски. - Afrikaans, the canonical name for the code
af
, is wrong; it should be Африкански. - Amharic, the canonical name for the code
am
, is wrong; it should be Амхарски. - Southern Amami Ōshima, the canonical name for the code
ams
, is wrong; it should be Southern Amami-Oshima. - Old English, the canonical name for the code
ang
, is wrong; it should be Стари Енглески. - Arabic, the canonical name for the code
ar
, is wrong; it should be Арапски. - Aramaic, the canonical name for the code
arc
, is wrong; it should be Арамејски. - American Sign Language, the canonical name for the code
ase
, is wrong; it should be Амерички знаковни језик. - Azerbaijani, the canonical name for the code
az
, is wrong; it should be Азербејџански. - Belarusian, the canonical name for the code
be
, is wrong; it should be Белоруски. - Bulgarian, the canonical name for the code
bg
, is wrong; it should be Бугарски. - Braj, the canonical name for the code
bra
, is wrong; it should be Брај. - Catalan, the canonical name for the code
ca
, is wrong; it should be Каталонски. - Mandarin, the canonical name for the code
cmn
, is wrong; it should be Мандарин. - Corsican, the canonical name for the code
co
, is wrong; it should be Корзички. - Czech, the canonical name for the code
cs
, is wrong; it should be Чешки. - Welsh, the canonical name for the code
cy
, is wrong; it should be Велшки. - Danish, the canonical name for the code
da
, is wrong; it should be Дански. - German, the canonical name for the code
de
, is wrong; it should be Немачки. - Dungan, the canonical name for the code
dng
, is wrong; it should be Дунган. - Greek, the canonical name for the code
el
, is wrong; it should be Грчки. - English, the canonical name for the code
en
, is wrong; it should be Енглески. - Middle English, the canonical name for the code
enm
, is wrong; it should be Средњи Енглески. - Esperanto, the canonical name for the code
eo
, is wrong; it should be Есперанто. - Spanish, the canonical name for the code
es
, is wrong; it should be Шпански. - Basque, the canonical name for the code
eu
, is wrong; it should be Баскијски. - Finnish, the canonical name for the code
fi
, is wrong; it should be Фински. - French, the canonical name for the code
fr
, is wrong; it should be Француски. - Old French, the canonical name for the code
fro
, is wrong; it should be Стари Француски. - Irish, the canonical name for the code
ga
, is wrong; it should be Ирски. - Proto-West Germanic, the canonical name for the code
gmw-pro
, is wrong; it should be Пра-Западно Германски. - Gothic, the canonical name for the code
got
, is wrong; it should be Готски. - Ancient Greek, the canonical name for the code
grc
, is wrong; it should be Антички Грчки. - Gujarati, the canonical name for the code
gu
, is wrong; it should be Гуџарати. - Hawaiian, the canonical name for the code
haw
, is wrong; it should be Хавајски. - Hebrew, the canonical name for the code
he
, is wrong; it should be Хебрејски. - Hindi, the canonical name for the code
hi
, is wrong; it should be Хинди. - Hungarian, the canonical name for the code
hu
, is wrong; it should be Мађарски. - Armenian, the canonical name for the code
hy
, is wrong; it should be Јерменски. - Ido, the canonical name for the code
io
, is wrong; it should be Идо. - Italian, the canonical name for the code
it
, is wrong; it should be Италијански. - Japanese, the canonical name for the code
ja
, is wrong; it should be Јапански. - Korean, the canonical name for the code
ko
, is wrong; it should be Корејски. - Latin, the canonical name for the code
la
, is wrong; it should be Латински. - Ladino, the canonical name for the code
lad
, is wrong; it should be Ладино. - Macedonian, the canonical name for the code
mk
, is wrong; it should be Македонски. - Malayalam, the canonical name for the code
ml
, is wrong; it should be Малајалам. - Mongolian, the canonical name for the code
mn
, is wrong; it should be Монголски. - Marathi, the canonical name for the code
mr
, is wrong; it should be Марати. - Malay, the canonical name for the code
ms
, is wrong; it should be Малајски. - Maltese, the canonical name for the code
mt
, is wrong; it should be Малтешки. - Translingual, the canonical name for the code
mul
, is wrong; it should be Међународни. - Nepali, the canonical name for the code
ne
, is wrong; it should be Непали. - Dutch, the canonical name for the code
nl
, is wrong; it should be Холандски. - Norwegian, the canonical name for the code
no
, is wrong; it should be Норвешки. - Moabite, the canonical name for the code
obm
, is wrong; it should be Моавски. - Okinoerabu, the canonical name for the code
okn
, is wrong; it should be Oki-No-Erabu. - Old Marathi, the canonical name for the code
omr
, is wrong; it should be Стари Марати. - Old Tamil, the canonical name for the code
oty
, is wrong; it should be Стари Тамилски. - Pali, the canonical name for the code
pi
, is wrong; it should be Пали. - Polish, the canonical name for the code
pl
, is wrong; it should be Пољски. - Portuguese, the canonical name for the code
pt
, is wrong; it should be Португалски. - Romanian, the canonical name for the code
ro
, is wrong; it should be Румунски. - Russian, the canonical name for the code
ru
, is wrong; it should be Руски. - Sanskrit, the canonical name for the code
sa
, is wrong; it should be Санскрт. - Scots, the canonical name for the code
sco
, is wrong; it should be Шкотски. - Serbo-Croatian, the canonical name for the code
sh
, is wrong; it should be Српскохрватски. - Slovak, the canonical name for the code
sk
, is wrong; it should be Словачки. - Slovene, the canonical name for the code
sl
, is wrong; it should be Словенски. - Proto-Slavic, the canonical name for the code
sla-pro
, is wrong; it should be Пра-Словенски. - Albanian, the canonical name for the code
sq
, is wrong; it should be Албански. - Swedish, the canonical name for the code
sv
, is wrong; it should be Шведски. - Thai, the canonical name for the code
th
, is wrong; it should be Тајски. - Tokunoshima, the canonical name for the code
tkn
, is wrong; it should be Toku-No-Shima. - Tagalog, the canonical name for the code
tl
, is wrong; it should be Тагалог. - Tok Pisin, the canonical name for the code
tpi
, is wrong; it should be Ток Писин. - Turkish, the canonical name for the code
tr
, is wrong; it should be Турски. - Ukrainian, the canonical name for the code
uk
, is wrong; it should be Украјински. - Vietnamese, the canonical name for the code
vi
, is wrong; it should be Вијетнамски. - Yiddish, the canonical name for the code
yi
, is wrong; it should be Јидиш. - Cantonese, the canonical name for the code
yue
, is wrong; it should be Кантонски.
- Literary Chinese, the canonical name for the code
lzh-lit
, is wrong; it should be Literary Chinese. - The code
nds-lpr
and the canonical name Low Prussian should be removed; they are not found in Модул:etymology languages/data.
- Literary Chinese, the canonical name for the code
lzh-lit
, is wrong; it should be Literary Chinese.
- The canonical name North Germanic (
gmq
) is missing. - Северно германски, the canonical name for the code
gmq
, is wrong; it should be North Germanic. - The code
ira-mid
and the canonical name Middle Iranian should be removed; they are not found in Module:families/data. - The code
ira-old
and the canonical name Old Iranian should be removed; they are not found in Module:families/data. - The canonical name Northern Ryukyuan (
jpx-nry
) is missing. - The canonical name Southern Ryukyuan (
jpx-sry
) is missing.
- Indo-Aryan, the canonical name for the code
inc
, is wrong; it should be Индо-Аријан. - Indo-European, the canonical name for the code
ine
, is wrong; it should be Индо-Европски. - Balto-Slavic, the canonical name for the code
ine-bsl
, is wrong; it should be Балтословенски. - The code
ira-mid
and the canonical name Middle Iranian should be removed; they are not found in Module:families/data. - The code
ira-old
and the canonical name Old Iranian should be removed; they are not found in Module:families/data. - Slavic, the canonical name for the code
sla
, is wrong; it should be Словенски. - East Slavic, the canonical name for the code
zle
, is wrong; it should be Источнословенски.
Required values
[уреди]Every entry in the table must contain the following indexed fields:
1
- The "canonical" name of the language. This is the name that is used in Wiktionary entries and category names.
2
- The Wikidata item id (Q number) for the language. Can be specified as a number (a positive integer) or a string that starts with
Q
and ends with decimal digits. Set tonil
if not known/present. This replaces the olderwikipedia_article
property, which can still be used to link to specific sections or language editions.
Optional values
[уреди]3
- The code for the family that the language belongs to. See Викиречник:Фамилије.
4
- A list of script codes. See Викиречник:Писма. These represent all the scripts (writing systems) that this language uses in the real world, as well as the ones that Wiktionary uses. The scripts that are used most often on Wiktionary should be first in the list, as this will speed up script detection.
- Many templates and modules detect the script of text in a particular language using the
findBestScript
function in Модул:scripts. This function goes down the list of scripts and counts how many characters in the text belong to each script. If all the characters belong to one script, that script will be returned; otherwise, the script with the most characters will be returned. Thus, script detection will be faster if the most frequently used scripts are first in the list. If none of the characters match any of the listed scripts, then theNone
script is returned (even if the characters would match a script not listed). Translingual (mul
) and Undetermined (und
) have the special value"All"
, which means they are treated as having every script. This value should not be set for any other language codes. - Due to the ongoing problems with Lua memory limits, this should be given as a comma-separated list in a string (and not a table). This is then converted into a table when returned. For example:
"Latn, Brai, Shaw, Dsrt"
. type
- The type of language (which affects how it is handled on Wiktionary). Possible values are:
regular
- This value is the default, so it doesn't need to be specified. It indicates that the is attested according to WT:CFI and therefore permitted in the main namespace. There may also be reconstructed terms for the language, which are placed in the Reconstruction namespace and must be prefixed with * to indicate a reconstruction.reconstructed
- This language is not attested according to CFI, and therefore is allowed only in the Reconstruction namespace. All terms in this language are reconstructed, and must be prefixed with *.appendix-constructed
- This language is attested but does not meet the additional requirements set out for constructed languages (WT:CFI#Constructed languages). Its entries must therefore be in the Appendix namespace, but they are not reconstructed and therefore should not have * prefixed in links.
ancestors
- A list of the language codes of the direct ancestors of this language. For example, the ancestor of English is listed as
enm
(Middle English);ang
(Old English, the ancestor of Middle English),gem-pro
(Proto-Germanic, the ancestor of Old English), andine-pro
(Proto-Indo-European, the ancestor of Proto-Germanic) are not listed. - For most languages, only one ancestor code should be given, but multiple ancestors can be listed for pidgins, creoles and mixed languages.
- The ancestor language list should not be included if the language's direct ancestor is the proto-language of the family to which the language belongs. In such a case, if the family code has been provided, Модул:languages will automatically add the proto-language as the language's ancestor. For example, Proto-Germanic (
gem-pro
) belongs to the Indo-European (ine
) family, and its direct ancestor is Proto-Indo-European (ine-pro
). Because Proto-Indo-European is the proto-language of the Indo-European languages, Proto-Germanic does not need anancestors
table; Proto-Indo-European will be automatically returned as its ancestor by thegetAncestors
function. - Due to the ongoing problems with Lua memory limits, this should be given as a comma-separated list in a string (and not a table). This is then converted into a table when returned. For example:
"cr, fr"
. wikimedia_codes
- A list of the Викимедија језички кодови that this language maps to. This is used to translate Wiktionary codes to Wikimedia codes, which are usually the same but there are a few languages where it is different. The language codes must be valid Wikimedia codes (as determined by the wiki software), and if they are not defined in one of the language data modules, they must be defined in Модул:wikimedia languages/data.
- Due to the ongoing problems with Lua memory limits, this should be given as a comma-separated list in a string (and not a table). This is then converted into a table when returned. For example:
"en, simple"
. wikipedia_article
- The name of the Wikipedia article for the language. Should normally only be supplied if the Wikidata id cannot be used.
translit
- See the Substitutions section for instructions on syntax.
- Defines how a language should be transliterated, which will be automatically applied to any terms in scripts that do not have their
isTransliterated
value set tofalse
in Модул:scripts/data. This is used bytransliterate
in Модул:languages. link_tr
- Set this to
true
to link the language's transliteration. For instance, Gothic has entries in Gothic script and entries for transliterations: 𐌷𐌻𐌰𐌹𐌱𐍃 (hlaibs). override_translit
- Set this to
true
to make the automatic transliteration override an eventual manual transliteration. display_text
- See the Substitutions section for instructions on syntax.
- Defines replacements to create the display form of the text, which is the form actually displayed on the page. This is occasionally necessary if there is a recurring issue of editors adding the wrong character, which is sometimes an issue when two or more characters are easy to confuse. For example, the palochka
ӏ
, used in Cyrillic in many Caucasian languages, is frequently entered asI
, or even Latinl
orI
. As this is an ongoing issue (even among native speakers), the easiest way to solve the problem is to automatically correct the display form for those languages. This is used bymakeDisplayText
in Module:languages. entry_name
- See the Substitutions section for instructions on syntax.
- Defines replacements to create the entry name from the displayed form of a term. This can be used to remove certain diacritical marks according to the customs or standard practice of the language. For example, it is used to remove accent marks from Russian words (
ру́сский
→русский
), or macrons from Latin or Old English words (ōs
→os
), as these are not used in the normal written form of these languages. This is used bymakeEntryName
in Module:languages. sort_key
- See the Substitutions section for instructions on syntax.
- Defines replacements to create a category sort key from the page name. The purpose is to:
- Remove any characters that should be ignored in sorting.
- Replace characters with other characters, if the sorting rules for that language do not distinguish them. For example, in German, the characters "ä" and "a" are considered equivalent for sorting, and are both treated as "a".
- Replace characters that should be sorted in different places with special characters that mimic that behaviour, (which is necessary due to MediaWiki software using the Unicode codepoint to determine sort order, which is often arbitrary). For instance, in Mongolian, the letter "ү" should be sorted after "у", but due to its codepoint it is sorted after the final letter "я" by default. As such, we can replace "ү" with "у" plus a character with a very high codepoint, which ensures that it is always sorted straight after. The data modules contain an in-built way to do this for the sake of convenience: with the above example, this would be done by using
"у" .. p[1]
. Another character could be inserted straight after by using"у" .. p[2]
(and so on).
- Note: the term is converted to lowercase before applying any substitutions, so you should not try to process capital letters (as it will not work). This is used by
makeSortKey
in Module:languages. dotted_dotless_i
- Set this to
true
for languages that distinguish between the dotted and dotless I (such as some Turkic languages).
Substitutions
[уреди]translit
,display_text
,entry_name
andsort_key
all use the same syntax, which is designed to be as flexible as possible:- If they are a string, then this is treated as the name of a dedicated module which will be used to generate the output. For example,
"sa-translit"
refers to Module:sa-translit. - If they are a table, then it can contain two kinds of keys:
- The keys
from
,to
,remove_diacritics
andremove_exceptions
relate to text substitution (see below). - Script code keys are used to specify script-specific behaviour. These, in turn, can be strings (for dedicated modules) or tables (for text substitution). In addition, a value with the key
1
can be used as a fallback, which will be used if no specific behaviour is defined for that script.
- The keys
- Note: if script keys and text substitution keys are given in the same table, then the text substitution will be applied after the script-specific behaviour has completed. Ensure any fallback text substitutions are given as a subtable with key
1
if you want to avoid this. It is not possible to process the output of a script-specific module with another module, however: this should be done (for example) with a tail call in the first module.
- If they are a string, then this is treated as the name of a dedicated module which will be used to generate the output. For example,
- Dedicated modules must take the arguments
text, lang, sc
, wheretext
is the input text (usually the page name or input by the user),lang
is the language code (not the language object), andsc
is the script code (not the script object). For performance reasons, they should only be used when it is not possible to achieve the desired result via text substitution. - Text substitution replaces or removes certain characters (or sets of characters) for particular contexts. There are three ways to do this:
- Using the
from
andto
keys. remove_diacritics
(and optionallyremove_exceptions
).- Both of the above (in that order).
- Using the
from
is paired withto
, and both of them must be tables that are organised pairwise: each element infrom
is a pattern to identify which characters in the term to replace, while the corresponding element into
defines what to replace them with (as arguments tomw.ustring.gsub
).- If the replacement is not present (or if it is
false
ornil
), then any matching characters are removed altogether. This means that thefrom
list can be longer than theto
list, and an empty replacement will be assumed for any elements infrom
that have no counterpart into
. - The tables can contain literal characters, or the patterns (a simplified form regular expressions) that are used by the standard Scribunto
mw.ustring.gsub
function. See the Scribunto reference manual for more information. Note that patterns make double substitutions a viable way to achieve more complex results. See the Latin sortkey for Mandarin (cmn
) as an example of this. remove_diacritics
is a string which contains characters that will be removed after the text is decomposed. For instance, ifremove_diacritics
is a combining acute accent, all acute accents will be stripped, even if they are part of precomposed characters (such as á or ά). Despite the name, the characters to be stripped need not be diacritics: for instance, including an apostrophe would remove all apostrophes (though be careful with hyphens, which must be be escaped as%-
).- Furthermore, if
remove_diacritics
is given, then it is possible to specify aremove_exceptions
table, which prevents specific characters from having their diacritics stripped. For instance, ifremove_diacritics
is a combining diaeresis, butremove_exceptions
contains"ё"
, then any instances ofё
will remain unchanged. On the other hand, an instance ofӱ
would still becomeу
(unless"ӱ"
is also added toremove_exceptions
).
Formerly supported values
[уреди]aliases
,varieties
,otherNames
- This data is now located in the extra data modules; see Module:languages and Template:language extradata documentation.
family
- Now
3
. scripts
- Now
4
.