View source for Module:Language/data/ISO 639 name to code/make
MyWikiBiz, Author Your Legacy — Saturday July 26, 2025
Jump to navigationJump to searchYou do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
require('Module:No globals');
local temp = {};
--[[--------------------------< A D D _ L A N G >--------------------------------------------------------------
temp table is a table of tables where the key is the language name and the value is a table listing the ISO 639
codes associated with that language name.
This function adds language name (as index) and its code (as a table element) using an appropriate index number.
<lang> is the language name from the source data
<code> is the associated ISO 639 code from the source data
<part> is 1 for ISO 639-1 language names and codes, 2, 2B, 3, 5. <part> for the override data is prefixed with 'O'
]]
local function lang_add (lang, code, part)
part = ({ -- convert string <part> to a numeric index
['1']=1, ['2']=2, ['2B']=3, ['3']=4, ['5']=5, -- for the base ISO 639 parts
['O1']=6, ['O2']=7, ['O2B']=8, ['O3']=9, ['O5']=10, -- for the override tables
000
1:0
Templates used on this page: