Module:Lang/data: Difference between revisions

+ems;
m (1 revision imported)
(+ems;)
Line 10: Line 10:
all of these data come from separate modules that are derived from the IANA language-subtag-registry file
all of these data come from separate modules that are derived from the IANA language-subtag-registry file


key_to_lower() avoids the metatable trap and sets all keys in the subtables to lowercase. Many language codes
key_to_lower() avoids the metatable trap and sets all keys in the subtables to lowercase. Many language codes
have multiple associated names; Module:lang is only concerned with the first name so key_to_lower() only fetches
have multiple associated names; Module:lang is only concerned with the first name so key_to_lower() only fetches
the first name.
the first name.
Line 24: Line 24:
local function key_to_lower (module, src_type)
local function key_to_lower (module, src_type)
local out = {};
local out = {};
local source = (('variants' == src_type) and require (module)) or mw.loadData (module); -- fetch data from this module; require() avoids metatable trap for variant data
local source = (('var_sup' == src_type) and require (module)) or mw.loadData (module); -- fetch data from this module; require() avoids metatable trap for variant data
if 'variants' == src_type then
if 'var_sup' == src_type then
for k, v in pairs (source) do
for k, v in pairs (source) do
out[k:lower()] = v; -- for variant, everything is needed
out[k:lower()] = v; -- for variant, everything is needed
Line 53: Line 53:
script = key_to_lower ('Module:Language/data/iana scripts'), -- script keys are capitalized; set to lower
script = key_to_lower ('Module:Language/data/iana scripts'), -- script keys are capitalized; set to lower
region = key_to_lower ('Module:Language/data/iana regions'), -- region keys are uppercase; set to lower
region = key_to_lower ('Module:Language/data/iana regions'), -- region keys are uppercase; set to lower
variant = key_to_lower ('Module:Language/data/iana variants', 'variants'),
variant = key_to_lower ('Module:Language/data/iana variants', 'var_sup'),
suppressed = key_to_lower ('Module:Language/data/iana suppressed scripts'), -- script keys are capitalized; set to lower
suppressed = key_to_lower ('Module:Language/data/iana suppressed scripts', 'var_sup'), -- script keys are capitalized; set to lower
}
}


Line 67: Line 67:


local override = {
local override = {
------------------------------< I S O   6 3 9 - 1 >------------------------------------------------------------
------------------------------< I S O _ 6 3 9 - 1 >------------------------------------------------------------


["ca-valencia"] = {"Valencian"},
["ca-valencia"] = {"Valencian"},
Line 93: Line 93:
["bo"] = {"Standard Tibetan"}, -- Tibetan
["bo"] = {"Standard Tibetan"}, -- Tibetan
["el"] = {"Greek"}, -- Modern Greek
["el"] = {"Greek"}, -- Modern Greek
-- ["en-SA"] = {"South African English"}, -- English; no; SA is not South Africa it Saudi Arabia; ZA is South Africa
-- ["en-SA"] = {"South African English"}, -- English; no; SA is not South Africa it Saudi Arabia; ZA is South Africa
["ff"] = {"Fula"}, -- Fulah
["ff"] = {"Fula"}, -- Fulah
["ht"] = {"Haitian Creole"}, -- Haitian
["ht"] = {"Haitian Creole"}, -- Haitian
Line 121: Line 121:




------------------------------< I S O   6 3 9 - 2,  - 3,  - 5 >----------------------------------------------
------------------------------< I S O _ 6 3 9 - 2,  - 3,  - 5 >----------------------------------------------


["arc"] = {"Aramaic"}, -- Official Aramaic (700-300 BCE), Imperial Aramaic (700-300 BCE);
["arc"] = {"Aramaic"}, -- Official Aramaic (700-300 BCE), Imperial Aramaic (700-300 BCE);
Line 133: Line 133:
["byr"] = {"Yipma"}, -- Baruya, Yipma
["byr"] = {"Yipma"}, -- Baruya, Yipma
["egy"] = {"Ancient Egyptian"}, -- Egyptian (Ancient); distinguish from contemporary arz: Egyptian Arabic  
["egy"] = {"Ancient Egyptian"}, -- Egyptian (Ancient); distinguish from contemporary arz: Egyptian Arabic  
["ems"] = {"Alutiiq"}, -- Pacific Gulf Yupik; to match en.wiki article title
["frr"] = {"North Frisian"}, -- Northern Frisian
["frr"] = {"North Frisian"}, -- Northern Frisian
["frs"] = {"East Frisian Low Saxon"}, -- Eastern Frisian
["frs"] = {"East Frisian Low Saxon"}, -- Eastern Frisian
Line 230: Line 231:




------------------------------< P R I V A T E - U S E   T A G S >----------------------------------------------
------------------------------< P R I V A T E _ U S E _ T A G S >----------------------------------------------


["cel-x-proto"] = {"Proto-Celtic"}, -- cel in IANA is Celtic languages
["cel-x-proto"] = {"Proto-Celtic"}, -- cel in IANA is Celtic languages
["gem-x-proto"] = {"Proto-Germanic"}, -- gem in IANA is Germanic languages
["gem-x-proto"] = {"Proto-Germanic"}, -- gem in IANA is Germanic languages
["gmw-x-ecg"] = {"East Central German"},
["grc-x-aeolic"] = {"Aeolic Greek"}, -- these grc-x-... codes are preferred alternates to the non-standard catchall code grc-gre
["grc-x-aeolic"] = {"Aeolic Greek"}, -- these grc-x-... codes are preferred alternates to the non-standard catchall code grc-gre
["grc-x-attic"] = {"Attic Greek"},
["grc-x-attic"] = {"Attic Greek"},
Line 247: Line 249:
["grk-x-proto"] = {"Proto-Greek"}, -- grk in IANA is Greek languages
["grk-x-proto"] = {"Proto-Greek"}, -- grk in IANA is Greek languages
["iir-x-proto"] = {"Proto-Indo-Iranian"}, -- iir in IANA is Indo-Iranian Languages
["iir-x-proto"] = {"Proto-Indo-Iranian"}, -- iir in IANA is Indo-Iranian Languages
["ine-x-proto"] = {"Proto-Indo-European"},
["ira-x-proto"] = {"Proto-Iranian"}, -- ira in IANA is Iranian languages
["ira-x-proto"] = {"Proto-Iranian"}, -- ira in IANA is Iranian languages
["itc-x-proto"] = {"Proto-Italic"}, -- itc in IANA is Italic languages
["itc-x-proto"] = {"Proto-Italic"}, -- itc in IANA is Italic languages
["ksh-x-colog"] = {"Colognian"}, -- en.wiki article is Colognian; ksh (Kölsch) redirects there
["ksh-x-colog"] = {"Colognian"}, -- en.wiki article is Colognian; ksh (Kölsch) redirects there
["la-x-medieval"] = {"Medieval Latin"},
["mis-x-ripuar"] = {"Ripuarian"}, -- replaces improper use of ksh in wp_languages
["mis-x-ripuar"] = {"Ripuarian"}, -- replaces improper use of ksh in wp_languages
["sem-x-proto"] = {"Proto-Semitic"},
["sla-x-proto"] = {"Proto-Slavic"}, -- sla in IANA is Slavic languages
["sla-x-proto"] = {"Proto-Slavic"}, -- sla in IANA is Slavic languages
["yuf-x-hav"] = {"Havasupai"}, -- IANA name for these three is Havasupai-Walapai-Yavapai
["yuf-x-hav"] = {"Havasupai"}, -- IANA name for these three is Havasupai-Walapai-Yavapai
Line 261: Line 266:


for those rare occasions when article titles don't fit with the normal '<language name>-language', this table
for those rare occasions when article titles don't fit with the normal '<language name>-language', this table
maps language code to article title. Use of this table should be avoided and the use of redirects preferred as
maps language code to article title. Use of this table should be avoided and the use of redirects preferred as
that is the long-standing method of handling article names that don't fit with the normal pattern
that is the long-standing method of handling article names that don't fit with the normal pattern


Line 277: Line 282:
--[=[-------------------------< R T L _ S C R I P T S >--------------------------------------------------------
--[=[-------------------------< R T L _ S C R I P T S >--------------------------------------------------------


ISO 15924 scripts that are written right-to-left. Data in this table taken from [[ISO 15924#List of codes]]
ISO 15924 scripts that are written right-to-left. Data in this table taken from [[ISO 15924#List of codes]]


last update to this list: 2017-12-24
last update to this list: 2017-12-24
Line 291: Line 296:




--[[--------------------------< T R A N S L I T   T I T L E S >------------------------------------------------
--[[--------------------------< T R A N S L I T _ T I T L E S >------------------------------------------------


This is a table of tables of transliteration standards and the language codes or language scripts that apply to
This is a table of tables of transliteration standards and the language codes or language scripts that apply to
those standards. This table is used to create the tool-tip text associated with the transliterated text displayed
those standards. This table is used to create the tool-tip text associated with the transliterated text displayed
by some of the {{lang-??}} templates.
by some of the {{lang-??}} templates.


These tables are more-or-less copied directly from {{transl}}. The standard 'NO_STD' is a construct to allow for
These tables are more-or-less copied directly from {{transl}}. The standard 'NO_STD' is a construct to allow for
the cases when no |std= parameter value is provided.
the cases when no |std= parameter value is provided.


Line 486: Line 491:
['satts'] = {
['satts'] = {
['default'] = 'Standard Arabic Technical Transliteration System transliteration',
['default'] = 'Standard Arabic Technical Transliteration System transliteration',
},
['scientific'] = {
['default'] = 'scientific transliteration',
},
['ukrainian'] = {
['default'] = 'Ukrainian National system of romanization',
},
},


Anonymous user