Module:Lang/data/sandbox explained

local lang_obj = mw.language.getContentLanguage;local this_wiki_lang_tag = lang_obj.code; -- get this wiki's language tag

--

local function key_to_lower (module, src_type) local out = ; 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 'var_sup'

src_type then for k, v in pairs (source) do out[k:lower] = v; -- for variant and suppressed everything is needed end

elseif 'lang'

src_type and source.active then -- for ~/iana_languages (active) for k, v in pairs (source.active) do out[k:lower] = v[1]; -- ignore multiple names; take first name only end

elseif 'lang_dep'

src_type and source.deprecated then -- for ~/iana_languages (deprecated) for k, v in pairs (source.deprecated) do out[k:lower] = v[1]; -- ignore multiple names; take first name only end

else -- here for all other sources for k, v in pairs (source) do out[k:lower] = v[1]; -- ignore multiple names; take first name only end end return out;end

local lang_name_table_t =

--

local media_wiki_override_enable = false; -- set to true to override IANA names with MediaWiki names; always false at en.wiki -- caveat lector: the list of MediaWiki language names for your language may not be complete or may not exist at all if true

media_wiki_override_enable then local mw_languages_by_tag_t = mw.language.fetchLanguageNames (this_wiki_lang_tag, 'all'); -- get a table of language tag/name pairs known to MediaWiki for tag, name in pairs (mw_languages_by_tag_t) do -- loop through each tag/name pair in the MediaWiki list if lang_name_table_t.lang[tag] then -- if the tag is in the main list lang_name_table_t.lang[tag] = name; -- overwrite exisiting name with the name from MediaWiki end end end

----------------------------< O V E R R I D E >--------------------------------------------------------------

Language codes and names in this table override the BCP47 names in lang_name_table.

indexes in this table shall always be lower case

local override =

----------------------------< A R T I C L E _ L I N K >------------------------------------------------------

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

local article_name =

--[=[-------------------------< 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]]

last update to this list: 2017-12-24

]=]

local rtl_scripts = ;

--std= parameter value is provided.

local translit_title_table = ;

return ;