Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Multilingual description/sort: Difference between revisions

From Neodyland Wiki
m there are missing languages and a few still not sorted correctly (still testing this list, will create a test module for that)
m 198 revisions imported
 
(192 intermediate revisions by 9 users not shown)
Line 1: Line 1:
--[[
--[=[
   The documented sort order is by script, then alphabetically by displayed native name (as generated by {{#language: code}}), using the default DUCET order.
   The documented sort order is by script, then alphabetically by displayed native name (as generated by {{#language: code}}), using the default DUCET order.
   This allows easier selection by users reading the lists of languages in order to find their own.
   This allows easier selection by users reading the lists of languages in order to find their own.
   Please test this order, and maintain it as complete as possible, including legacy codes still used in MediaWiki.
   Please test this order, and maintain it as complete as possible, including legacy codes still used in MediaWiki.
]]
  Any missing language will be sorted after all languages listed below, just using its internal language code.
return {
]=]
local p = {
-- LTR scripts
-- LTR scripts
   -- Latin script
   -- Latin alphabets
     --[[A]] 'af', 'an', 'ang', 'als', 'ast', 'az',
     --[['-latn', '-latf', '-latg',]]
     --[[B]] 'id', 'bar', 'bs', 'br', 'jv',
     --[[A]] 'aig', 'sma', 'abr', 'ace', 'ang', 'af', 'agq', 'ak', 'gsw', 'als', 'en-us', 'ase', 'smn', 'an', 'aae', 'rup', 'roa-rup', 'frp', 'ast', 'atj', 'gn', 'ay', 'az',
    --[[C]] 'ca', 'ceb', 'chr', 'cr', 'crh', 'cs', 'csb', 'cy',
     --[[B]] 'ksf', 'bfd', 'abs', 'gor', 'id', 'ms', 'bdr', 'bkc', 'bkh', 'bm', 'bax', 'zh-min-nan', 'nan-latn-pehoeji', 'nan-latn-tailo', 'bjn', 'ban', 'jv-x-bms', 'map-bms', 'bug', 'bug-latn', 'bas', 'mui', 'btm', 'bbc', 'bbc-latn', 'zag', 'zag-latn', 'bew', 'sje', 'bcl', 'bi', 'bar', 'bol', 'bs', 'brh', 'br', 'en-gb',
    --[[D]] 'da', 'pdc', 'de', 'de-formal', 'nv', 'dsb',
     --[[C]] 'en-ca', 'cps', 'cal', 'ca', 'ceb', 'cs', 'cho', 'ch', 'cbk-zam', 'ny', 'chn', 'sn', 'tum', 'lua', 'sei', 'co', 'cy',
     --[[E]] 'en', 'simple', 'et', 'es', 'eo', 'eu', 'ext',
     --[[D]] 'dga', 'dag', 'da', 'se', 'se-no', 'se-se', 'se-fi', 'pdc', 'de', 'de-formal', 'de-latf', 'nv', 'dsb', 'non'--[[Dǫnsk tunga]], 'na', 'dua',
    --[[F]] 'fo', 'fr', 'fy',
     --[[E]] 'mh', 'et', 'efi', 'etu', 'vmw', 'egl', 'eml', 'en', 'es', 'es-formal', 'es-419', 'eo', 'ext', 'eto', 'eu', 'ee', 'ewo',
    --[[G]] 'ga', 'gl',
    --[[F]] 'wls', 'gur', 'fmp', 'hif', 'hif-latn', 'fil', 'fon', 'fo', 'fr', 'frc', 'fy', 'ff', 'fur',
    --[[H]] 'haw', 'hr', 'hsb', 'hu',
    --[[G]] 'gaa', 'ga', 'gv', 'sm', 'gag', 'gd', 'gl', 'gya', 'aln', 'gpe', 'bbj', 'ki', 'gom-latn', 'guw', 'hak-latn',
    --[[I]] 'ia', 'ie', 'ik', 'io', 'is', 'it',
    --[[H]] 'cnh', 'ha', 'ha-latn', 'haw', 'ho', 'hmn', 'hoc-latn', 'hsb', 'hr', 'hrx',
    --[[K]] 'kr', 'ksh', 'ku-latn', 'kw', 'ht',
    --[[I]] 'ibb', 'io', 'igl', 'ig', 'rw', 'rn', 'ilo', 'hil', 'ia', 'ie', 'ike-latn', 'ik', 'bto', 'nr', 'xh', 'zu', 'is', 'isu', 'it', 'iba',
    --[[L]] 'la', 'lb', 'lg', 'li', 'lv', 'lt',
    --[[J]] 'jv', 'kaj', 'smj', 'jut',
    --[[M]] 'mg', 'ms', 'mt',
    --[[K]] 'rmf', 'kbp', 'kea', 'dtp', 'kl', 'kr', 'pam', 'cak', 'kai', 'krl', 'csb', 'ker', 'kw', 'kha', 'hke', 'krj', 'kiu', 'sw', 'bkm', 'kg', 'avk', 'ses', 'ht', 'gcf'--[[kréyòl gwadloupéyen]], 'kri', 'gcr', 'kge', 'ku', 'ku-latn', 'kmr', 'kmr-latn', 'kus', 'fkv', 'kj', 'nmg', 'acf',
     --[[N]] 'nah', 'nan', 'nap', 'nl', 'no', 'nn',
    --[[L]] 'jbo', 'lld', 'lad', 'lkt', 'lns', 'ljp', 'ltg', 'la', 'lv', 'lzz', 'to', 'lb', 'nia', 'lt', 'lij', 'li', 'ln', 'lfn', 'liv', 'olo', 'lmo', 'lg',
    --[[O]] 'oc',
    --[[M]] 'yua', 'mad', 'hu', 'hu-formal', 'vmf', 'mcp', 'mak', 'mg', 'mt', 'mnc', 'mnc-latn', 'mi', 'arn', 'mrh', 'srq', 'fit', 'byv', 'isv', 'isv-latn', 'fat', 'min', 'cdo-latn', 'mwl', 'lus', 'bqz', 'cnr', 'cnr-latn', 'mos', 'mua', 'mus',
    --[[P]] 'pam', 'nds', 'nds-nl', 'pl', 'pms', 'pt', 'pt-br',
    --[[N]] 'fj', 'nah', 'pcm', 'nap', 'ppl', --[['nrm', should be Narom]] 'nmz', 'nnz', 'nl', 'nl-informal', 'nds-nl', 'cr', 'nge', 'nnh', 'nla', 'yrl', 'niu', 'lem', 'frr', 'pih', 'no', 'nb', 'nn', 'nrf'--[[Nouormand]], 'nrm'--[[currently Nouormand, should be Narom instead]], 'nov', 'yas', 'sms', 'nup', 'nys',
    --[[Q]] 'qu',
    --[[O]] 'uz-latn', 'uz', 'ann', 'oc', 'ojb', 'frs', 'om', 'nyo', 'ttj', 'ng', 'de-at', 'hz',
    --[[R]] 'rn', 'ro',
    --[[P]] 'pfl', 'pag', 'ami', 'pap-aw', 'pap', 'jam', 'pcd', 'wes', 'pms', 'pwn', 'nds', 'pdt', 'cpx-latn', 'pl', 'fvr', 'pt', 'pt-br', 'prg',
     --[[S]] 'sc', 'sco', 'se', 'sk', 'sl', 'sq', 'stq', 'su', 'fi', 'sv', 'sw', 'szl',
    --[[Q]] 'aa', 'kaa', 'quc', 'kk-latn', 'kk-tr', 'crh', 'crh-latn',
    --[[T]] 'tl', 'tr',
    --[[R]] 'ty', 'ksh', 'ro', 'rmc', 'rmy', 'rgn', 'rm', 'qug', 'qu', 'nyn',
     --[[V]] 'vec', 'vi', 'vo',
    --[[S]] 'xsy', 'szy', 'sg', 'sc', 'sro', 'sas', 'sdc', 'sli', 'de-ch', 'sco', 'trv', 'stq', 'st', 'nso', 'tn', 'sq', 'scn', 'loz', 'simple', 'ss', 'sk', 'sl', 'szl', 'so', 'srn', 'sr-latn', 'sr-el', 'sh-latn', 'sh-el', 'sh'--[[latn/cyrl]], 'su', 'fi', 'sv',
    --[[W]] 'wa', 'war',
    --[[T]] 'shy', 'shy-latn', 'shi', 'shi-latn', 'tl', 'tzl', 'zgh-latn', 'tpv', 'kab', 'scn-x-tara', 'roa-tara', 'rif', 'tt-latn', 'crh-ro', 'tay', 'tet', 'din', 'vi', 'tg-latn', 'tpi', 'tok', 'tly', 'chy', 've', 'bag', 'tvu', 'aeb-latn', 'tr', 'tk', 'tru', 'tw', 'kcg',
    --[[Y]] 'yo',
    --[[U]] 'sju', 'ug-latn',
    --[[Z]] 'diq', 'zu',
    --[[V]] 'vot', 'za', 'vec', 'vep', 'ruq', 'ruq-latn', 'vo', 'vro', 'fiu-vro', 'mcn', 'vut',
  -- Latin OR Cyrillic script
    --[[W]] 'wlx', 'wa', 'bci', 'guc', 'osa-latn', 'vls', 'wal', 'war', 'wo', 'wya',
  'sr', 'sh',
    --[[X]] 'ts',
  -- Cyrillic script
    --[[Y]] 'yat', 'yav', 'ybb', 'knc', 'yo',
  'ba', 'be', 'be-tarask', 'bg', 'cu', 'cv', 'kk', 'ky', 'lbe', 'mk', 'mo', 'os', 'ru', 'tg', 'tt', 'uk', 'xal',
    --[[Z]] 'diq', 'zea', 'sgs', 'bat-smg',
  -- Greek or Coptic script
  -- Greek  [-grek] and Coptic  [-copt] alphabets
  'el',
    --[['-grek']] 'grc', 'el', 'pnt',
  -- Other European alphabets
    --[['-copt',]] 'cop',
  'hy', 'ka',
  -- Cyrillic alphabets
  -- Indic scripts
    --[['-cyrl', '-cyrs',]]
  'bn', 'bpy', 'gu', 'hi', 'kn', 'ml', 'mr', 'ne', 'or', 'ta', 'te', 'bo', 'dz', 'km', 'lo', 'si', 'th',
    --[[А]] 'av', 'ady', 'ady-cyrl', 'kbd', 'kbd-cyrl', 'alt', 'ab',
  -- Syllabaries and Hangul
    --[[Б]] 'ba', 'be', 'be-tarask', 'be-x-old', 'bxr', 'bg',
  'am', 'ti',  
    --[[В]] 'ruq-cyrl',
  -- Korean alphabet and Japanese scripts (syllabaries and sinograms)
    --[[Г]] 'inh',
  'ko', 'ja',
--[[д]] 'dlg',
  -- Sinographic scripts
    --[[И]] 'os',
  'wuu', 'yue',
    --[[К]] 'sjd', 'kv', 'krc', 'kum', 'crh-cyrl', 'ky', 'mrj', 'kk', 'kk-cyrl', 'kk-kz',
  'zh', 'zh-hans', 'zh-cn', 'zh-sg',
    --[[Л]] 'lbe', 'lez',
  'zh-hant', 'zh-tw', 'zh-mo',
    --[[М]] 'mk', 'isv-cyrl', 'mdf', 'mo', 'mn', 'rut',
  'lzh', 'zh-classical',
    --[[Н]] 'gld', 'nog', 'ce',
    --[[О]] 'mhr',
    --[[П]] 'koi',
    --[[Р]] 'rue', 'rsk', 'ru',
    --[[C]] 'sah', 'sty', 'cu', 'sr-cyrl', 'sr-ec', 'sr'--[[cyrl/latn]], 'sh-cyrl', 'sh-ec',
    --[[Т]] 'tt-cyrl', 'tt', 'tly-cyrl', 'tg-cyrl', 'tg', 'tyv',
    --[[У]] 'udm', 'uz-cyrl', 'uk',
    --[[Х]] 'kjh', 'xal',
    --[[Ц]] 'cnr-cyrl',
    --[[Ч]] 'cv',
    --[[Э]] 'myv',
  -- Other alphabets (horizontal only)
    --[['-ital',]]
    --[['-glag',]]
    --[['-geor', '-geok',]] 'xmf', 'ka', 'sva',
    --[['-armn',]] 'hyw', 'hy',
  -- North Indian abugidas
    --[['-deva',]] 'anp', 'awa', 'xnr-deva', 'xnr', 'thq', 'ks-deva', 'gju-deva', 'kgg', 'gom-deva', 'gom', 'dgo-deva', 'dgo', 'doi-deva', 'doi', 'dty', 'new', 'ne', 'pi', 'bho', 'bh', 'mag', 'mr', 'rwr', 'mai', 'sa', 'bgc', 'hi',
    --[['-beng',]] 'as', 'rkt', 'bn', 'bpy',
    --[['-guru',]] 'pa',
    --[['-takr',]] 'xnr-takr', 'doi-takr', 'dgo-takr',
  -- South Indian abugidas
    --[['-gujr',]] 'gu',
    --[['-orya',]] 'or', 'dso', 'bfw',
    --[['-taml',]] 'ta',
    --[['-telu',]] 'nit', 'te',
    --[['-kanr',]] 'kn', 'tcy',
    --[['-mlym',]] 'ml',
    --[['-sinh',]] 'si',
  -- Tibeto-Burmese abugidas
    --[['-lepc',]] 'lep', 'lep-lepc',
    --[['-sylo',]] 'syl',
    --[['-tibt',]] 'dz', 'bo', 'lep-tibt',
    --[['-mtei',]] 'mni',
    --[['-bugi',]] 'bug-bugi',
    --[['-mymr',]] 'ksw', 'blk', 'kjp', 'shn', 'mnw', 'my', 'rki',
  -- Other Central and South-Eastern Asian abugidas
    --[['-cakm',]] 'ccp',
    --[['-khmr',]] 'km',
    --[['-thai',]] 'th',
    --[['-tale',]] 'tdd',
    --[['-lana',]] 'nod',
    --[['-laoo',]] 'lo',
    --[['-bali',]] 'ban-bali',
    --[['-java',]] 'jv-java',
    --[['-olck',]] 'sat',
    --[['-wara',]]
    --[['-pauc',]]
    --[['-mroo',]]
    --[['-medf',]]
    --[['-sunu',]]
    --[['-tnsa',]]
  -- American and European syllabaries
    --[['-cher',]] 'chr',
    --[['-osge',]] 'osa',
    --[['-cans',]] 'ike',  'ike-cans', 'iu',
    --[['-hmnp',]] 'hoc',
    --[['-goth',]] 'got',
    --[['-moon',]]
  -- African syllabaries
    --[['-tfng',]] 'tzm', 'zgh', 'shi-tfng', 'rif-tfng', 'sjs',
    --[['-ethi',]] 'tig', 'ti', 'am',
    --[['-berf',]] 'zag-berf',
    --[['-bass',]]
    --[['-osma',]]
    --[['-shaw',]]
    --[['-plrd',]]
  -- Hieroglyphic scripts
    --[['-egyd', '-egyh', '-egyp',]]
    --[['-hluw',]]
    --[['-mero','-merc',]]
    --[['-maya',]]
    --[['-nkdb',]]
    --[['-sgnw',]]
    --[['-visp',]]
  -- Asian syllabaries
    --[['-yiii',]] 'ii',
  -- Korean scripts (alphabet and sinograms)
    --[['-kore', '-hang', '-jamo',]] 'ko-kp', 'ko', 'ko-kr',
  -- Japanese scripts (syllabaries and sinograms)
    --[['-japn', '-hrkt', '-hira', '-kana',]] 'ja', 'ryu',
  -- Sinographic scripts (plus Bopomofo syllabary)
    --[['-hanb', '-hani', '-hans', '-hntl', '-hant', '-bopo',]]
    'zh', 'zh-cn', 'zh-sg', 'zh-mo', 'zh-hans', 'zh-hant', 'zh-tw', 'zh-hk', 'zh-my',
    'wuu-hant', 'wuu', 'wuu-hans',
    'hak', 'hak-hant', 'hak-hans',
    'lzh', 'zh-classical',
    'hsn',
    'yue', 'zh-yue', 'yue-hant', 'yue-hans',
    'cpx', 'cpx-hant', 'cpx-hans',
    'gan', 'gan-hant', 'gan-hans',
    'nan-hani', 'nan', 'nan-hant',
    'cdo', 'cdo-hant',
-- Other vertical scripts (that are rendered horizontally, when not rotated explicitly by style)
    --[['-mong',]] 'mnc-mong',
-- RTL scripts
-- RTL scripts
  -- Hebrew abjad
  -- Hebrew abjads
  'he', 'yi',
    --[['-hebr',]] 'yi', 'ydd', 'yih', 'he', 'hbo',
  -- Arabic abjads
  -- Arabic abjads
  'ar', 'arz', 'ckb', 'fa', 'glk', 'ks', 'ku', 'mzn', 'ps', 'sd', 'ug', 'ur'
    --[['-arab', '-aran',]]
    --[[ء]] -- [[ٴ]]
    --[[ئ]] 'ug-arab', 'ug',
    --[[ا]] 'ur', 'ary', 'ar', 'acq', 'uz-arab',
      --[[أ]] --[[ٱ]] --[[ٳ]] --[[ٲ]] --[[ا]] --[[آ]]
    --[[ب]] 'bqi', 'bsk', 'bgp' ,'bal', 'ms-arab',
      --[[ب]] --[[ٻ]] --[[ڀ]]
      --[[پ]] 'ps', 'pnb',
      --[[ت]] 'aeb-arab', 'aeb', 'azb',
      --[[ٺ]] --[[ٿ]] --[[ټ]] --[[ٽ]] --[[ٹ]]
    --[[ج]] 'arq', 'bcc',
      --[[ڃ]] --[[ڄ]] --[[چ]] --[[ڇ]] --[[ح]] --[[ځ]] --[[ڂ]] --[[څ]] --[[خ]]
    --[[د]] --[[ڋ]] --[[ڈ]] --[[ډ]] --[[ڊ]] --[[ڍ]] --[[ڎ]] --[[ڏ]] --[[ڐ]] --[[ذ]] --[[ڌ]]
    --[[ر]] 'bgn',
      --[[ڕ]] --[[ڒ]] --[[ڔ]] --[[ږ]] --[[ڗ]] --[[ڑ]] --[[ړ]] --[[ز]] --[[ڙ]] --[[ژ]]
    --[[س]] 'skr', 'skr-arab', 'sd',
      --[[ڛ]] --[[ښ]] --[[ڜ]]
      --[[ش]] 'apc', 'acm', 'ajp',
    --[[ص]] --[[ڝ]] --[[ڞ]] --[[ض]]
    --[[ط]] --[[ڟ]] --[[ظ]]
    --[[ع]] 'arb',
      --[[ڠ]] --[[غ]]
    --[[ڡ]]
      --[[ف]] 'fa-af', 'fa', 'prd',
      --[[ڢ]] --[[ڣ]] --[[ڤ]] --[[ڥ]] --[[ڦ]]
    --[[ق]] 'kk-arab', 'kk-cn',
      --[[ڧ]] --[[ڨ]]
    --[[ك]] 'ku-arab', 'kcn', 'kmr-arab',
      --[[ګ]] --[[ڮ]] --[[ڬ]] --[[ڭ]]
      --[[ک]] 'ks', 'ks-arab', 'pbt', 'khw', 'ckb', 'sdh',
      --[[ڪ]]
      --[[گ]] 'gju-arab', 'glk',
      --[[ڰ]] --[[ڱ]] --[[ڳ]] --[[ڲ]] --[[ڴ]]
    --[[ل]] 'ota', 'lrc', 'luz', 'lki',
      --[[ڵ]] --[[ڶ]] --[[ڷ]]
    --[[م]] 'mve', 'mzn', 'arz', 'pst',
    --[[ں]] --[[ن]] --[[ڼ]] --[[ڻ]] --[[ڽ]]
    --[[ۃ]]
      --[[ه]] 'ha-arab',
      --[[ہ]] 'hno',
      --[[ھ]] --[[ۂ]] --[[ە]] --[[ۀ]]
    --[[و]] 'wne',
      --[[ۄ]] --[[ۆ]] --[[ۅ]] --[[ۇ]] --[[ۈ]] --[[ۉ]]
    --[[ې]] --[[ۍ]] --[[ى]] --[[ي]] --[[ێ]] --[[ۑ]] --[[ے]]
      --[[ی]] 'pbu',
      --[[ۓ]]
  -- Other semitics abjads
    --[['-samr', '-armi']] 'arc',
    --[['-syrc', '-syre', '-syrj', '-syrn',]] 'syc',
    --[['-thaa', '-diak',]] 'dv',
    --[['-nkoo',]] 'nqo',
    --[['-adlm',]]
    --[['-rohg',]]
    --[['-yezi',]]
    --[['-orkh',]]
    --[['-hung',]]
    --[['-sidt',]]
    --[['-gara',]]
    --[['-ugar',]]
    --[['-cari',]]
    --[['-lyci',]]
    --[['-lydi',]]
    --[['-palm',]]
    --[['-sarb',]]
    --[['-nbat',]]
    --[['-narb',]]
    --[['-hatr',]]
    --[['-elym',]]
    --[['-prti',]]
    --[['-phli', '-phlp', '-phlv',]]
    --[['-avst',]]
    --[['-pssin']]
    --[['-pelm',]]
    --[['-chrs',]]
    --[['-mani',]]
    --[['-mand',]]
    --[['-sogo', '-sogd',]]
    --[['-xpeo',]] 'xpu',
    --[['-xsux',]] 'phn',
    --[['-pcun',]]
-- Additional language codes that still need to be sorted by native name can be temporarily placed
   
}
}
setmetatable(p, {
    quickTests = function()
        local s = {}
        for k, lang in pairs(p) do
            if type(k) ~= 'number' or k < 1 or k ~= math.floor(k)
            or type(lang) ~= 'string' or #lang < 2 or #lang > 16
            or (lang):find('^[a-z][%-0-9a-z]*[0-9a-z]$') ~= 1
            or s[lang] then
                return false, ': invalid sequence of distinct lowercase language codes at p[' .. tostring(k) .. '] = "' .. tostring(lang) .. '"'
            end
            s[lang] = true
        end
        return true
    end
})
--[=[ To test this module in the Lua console: -- must return true
=getmetatable(p).quickTests()
--]=]
return p

Latest revision as of 06:05, 9 August 2026

Module documentation[ create · purge ]
--[=[
  The documented sort order is by script, then alphabetically by displayed native name (as generated by {{#language: code}}), using the default DUCET order.
  This allows easier selection by users reading the lists of languages in order to find their own.
  Please test this order, and maintain it as complete as possible, including legacy codes still used in MediaWiki.
  Any missing language will be sorted after all languages listed below, just using its internal language code.
]=]
local p = {
-- LTR scripts
  -- Latin alphabets
    --[['-latn', '-latf', '-latg',]]
    --[[A]] 'aig', 'sma', 'abr', 'ace', 'ang', 'af', 'agq', 'ak', 'gsw', 'als', 'en-us', 'ase', 'smn', 'an', 'aae', 'rup', 'roa-rup', 'frp', 'ast', 'atj', 'gn', 'ay', 'az',
    --[[B]] 'ksf', 'bfd', 'abs', 'gor', 'id', 'ms', 'bdr', 'bkc', 'bkh', 'bm', 'bax', 'zh-min-nan', 'nan-latn-pehoeji', 'nan-latn-tailo', 'bjn', 'ban', 'jv-x-bms', 'map-bms', 'bug', 'bug-latn', 'bas', 'mui', 'btm', 'bbc', 'bbc-latn', 'zag', 'zag-latn', 'bew', 'sje', 'bcl', 'bi', 'bar', 'bol', 'bs', 'brh', 'br', 'en-gb',
    --[[C]] 'en-ca', 'cps', 'cal', 'ca', 'ceb', 'cs', 'cho', 'ch', 'cbk-zam', 'ny', 'chn', 'sn', 'tum', 'lua', 'sei', 'co', 'cy',
    --[[D]] 'dga', 'dag', 'da', 'se', 'se-no', 'se-se', 'se-fi', 'pdc', 'de', 'de-formal', 'de-latf', 'nv', 'dsb', 'non'--[[Dǫnsk tunga]], 'na', 'dua',
    --[[E]] 'mh', 'et', 'efi', 'etu', 'vmw', 'egl', 'eml', 'en', 'es', 'es-formal', 'es-419', 'eo', 'ext', 'eto', 'eu', 'ee', 'ewo',
    --[[F]] 'wls', 'gur', 'fmp', 'hif', 'hif-latn', 'fil', 'fon', 'fo', 'fr', 'frc', 'fy', 'ff', 'fur',
    --[[G]] 'gaa', 'ga', 'gv', 'sm', 'gag', 'gd', 'gl', 'gya', 'aln', 'gpe', 'bbj', 'ki', 'gom-latn', 'guw', 'hak-latn',
    --[[H]] 'cnh', 'ha', 'ha-latn', 'haw', 'ho', 'hmn', 'hoc-latn', 'hsb', 'hr', 'hrx',
    --[[I]] 'ibb', 'io', 'igl', 'ig', 'rw', 'rn', 'ilo', 'hil', 'ia', 'ie', 'ike-latn', 'ik', 'bto', 'nr', 'xh', 'zu', 'is', 'isu', 'it', 'iba',
    --[[J]] 'jv', 'kaj', 'smj', 'jut',
    --[[K]] 'rmf', 'kbp', 'kea', 'dtp', 'kl', 'kr', 'pam', 'cak', 'kai', 'krl', 'csb', 'ker', 'kw', 'kha', 'hke', 'krj', 'kiu', 'sw', 'bkm', 'kg', 'avk', 'ses', 'ht', 'gcf'--[[kréyòl gwadloupéyen]], 'kri', 'gcr', 'kge', 'ku', 'ku-latn', 'kmr', 'kmr-latn', 'kus', 'fkv', 'kj', 'nmg', 'acf',
    --[[L]] 'jbo', 'lld', 'lad', 'lkt', 'lns', 'ljp', 'ltg', 'la', 'lv', 'lzz', 'to', 'lb', 'nia', 'lt', 'lij', 'li', 'ln', 'lfn', 'liv', 'olo', 'lmo', 'lg',
    --[[M]] 'yua', 'mad', 'hu', 'hu-formal', 'vmf', 'mcp', 'mak', 'mg', 'mt', 'mnc', 'mnc-latn', 'mi', 'arn', 'mrh', 'srq', 'fit', 'byv', 'isv', 'isv-latn', 'fat', 'min', 'cdo-latn', 'mwl', 'lus', 'bqz', 'cnr', 'cnr-latn', 'mos', 'mua', 'mus',
    --[[N]] 'fj', 'nah', 'pcm', 'nap', 'ppl', --[['nrm', should be Narom]] 'nmz', 'nnz', 'nl', 'nl-informal', 'nds-nl', 'cr', 'nge', 'nnh', 'nla', 'yrl', 'niu', 'lem', 'frr', 'pih', 'no', 'nb', 'nn', 'nrf'--[[Nouormand]], 'nrm'--[[currently Nouormand, should be Narom instead]], 'nov', 'yas', 'sms', 'nup', 'nys',
    --[[O]] 'uz-latn', 'uz', 'ann', 'oc', 'ojb', 'frs', 'om', 'nyo', 'ttj', 'ng', 'de-at', 'hz',
    --[[P]] 'pfl', 'pag', 'ami', 'pap-aw', 'pap', 'jam', 'pcd', 'wes', 'pms', 'pwn', 'nds', 'pdt', 'cpx-latn', 'pl', 'fvr', 'pt', 'pt-br', 'prg',
    --[[Q]] 'aa', 'kaa', 'quc', 'kk-latn', 'kk-tr', 'crh', 'crh-latn',
    --[[R]] 'ty', 'ksh', 'ro', 'rmc', 'rmy', 'rgn', 'rm', 'qug', 'qu', 'nyn',
    --[[S]] 'xsy', 'szy', 'sg', 'sc', 'sro', 'sas', 'sdc', 'sli', 'de-ch', 'sco', 'trv', 'stq', 'st', 'nso', 'tn', 'sq', 'scn', 'loz', 'simple', 'ss', 'sk', 'sl', 'szl', 'so', 'srn', 'sr-latn', 'sr-el', 'sh-latn', 'sh-el', 'sh'--[[latn/cyrl]], 'su', 'fi', 'sv',
    --[[T]] 'shy', 'shy-latn', 'shi', 'shi-latn', 'tl', 'tzl', 'zgh-latn', 'tpv', 'kab', 'scn-x-tara', 'roa-tara', 'rif', 'tt-latn', 'crh-ro', 'tay', 'tet', 'din', 'vi', 'tg-latn', 'tpi', 'tok', 'tly', 'chy', 've', 'bag', 'tvu', 'aeb-latn', 'tr', 'tk', 'tru', 'tw', 'kcg',
    --[[U]] 'sju', 'ug-latn',
    --[[V]] 'vot', 'za', 'vec', 'vep', 'ruq', 'ruq-latn', 'vo', 'vro', 'fiu-vro', 'mcn', 'vut',
    --[[W]] 'wlx', 'wa', 'bci', 'guc', 'osa-latn', 'vls', 'wal', 'war', 'wo', 'wya',
    --[[X]] 'ts',
    --[[Y]] 'yat', 'yav', 'ybb', 'knc', 'yo',
    --[[Z]] 'diq', 'zea', 'sgs', 'bat-smg',
  -- Greek  [-grek] and Coptic  [-copt] alphabets
    --[['-grek']] 'grc', 'el', 'pnt',
    --[['-copt',]] 'cop',
  -- Cyrillic alphabets
    --[['-cyrl', '-cyrs',]]
    --[[А]] 'av', 'ady', 'ady-cyrl', 'kbd', 'kbd-cyrl', 'alt', 'ab',
    --[[Б]] 'ba', 'be', 'be-tarask', 'be-x-old', 'bxr', 'bg',
    --[[В]] 'ruq-cyrl',
    --[[Г]] 'inh',
	--[[д]] 'dlg',
    --[[И]] 'os',
    --[[К]] 'sjd', 'kv', 'krc', 'kum', 'crh-cyrl', 'ky', 'mrj', 'kk', 'kk-cyrl', 'kk-kz',
    --[[Л]] 'lbe', 'lez',
    --[[М]] 'mk', 'isv-cyrl', 'mdf', 'mo', 'mn', 'rut',
    --[[Н]] 'gld', 'nog', 'ce',
    --[[О]] 'mhr',
    --[[П]] 'koi',
    --[[Р]] 'rue', 'rsk', 'ru',
    --[[C]] 'sah', 'sty', 'cu', 'sr-cyrl', 'sr-ec', 'sr'--[[cyrl/latn]], 'sh-cyrl', 'sh-ec',
    --[[Т]] 'tt-cyrl', 'tt', 'tly-cyrl', 'tg-cyrl', 'tg', 'tyv',
    --[[У]] 'udm', 'uz-cyrl', 'uk',
    --[[Х]] 'kjh', 'xal',
    --[[Ц]] 'cnr-cyrl',
    --[[Ч]] 'cv',
    --[[Э]] 'myv',
  -- Other alphabets (horizontal only)
    --[['-ital',]]
    --[['-glag',]]
    --[['-geor', '-geok',]] 'xmf', 'ka', 'sva',
    --[['-armn',]] 'hyw', 'hy',
  -- North Indian abugidas
    --[['-deva',]] 'anp', 'awa', 'xnr-deva', 'xnr', 'thq', 'ks-deva', 'gju-deva', 'kgg', 'gom-deva', 'gom', 'dgo-deva', 'dgo', 'doi-deva', 'doi', 'dty', 'new', 'ne', 'pi', 'bho', 'bh', 'mag', 'mr', 'rwr', 'mai', 'sa', 'bgc', 'hi',
    --[['-beng',]] 'as', 'rkt', 'bn', 'bpy',
    --[['-guru',]] 'pa',
    --[['-takr',]] 'xnr-takr', 'doi-takr', 'dgo-takr',
  -- South Indian abugidas
    --[['-gujr',]] 'gu',
    --[['-orya',]] 'or', 'dso', 'bfw',
    --[['-taml',]] 'ta',
    --[['-telu',]] 'nit', 'te',
    --[['-kanr',]] 'kn', 'tcy',
    --[['-mlym',]] 'ml',
    --[['-sinh',]] 'si',
  -- Tibeto-Burmese abugidas
    --[['-lepc',]] 'lep', 'lep-lepc',
    --[['-sylo',]] 'syl',
    --[['-tibt',]] 'dz', 'bo', 'lep-tibt',
    --[['-mtei',]] 'mni',
    --[['-bugi',]] 'bug-bugi',
    --[['-mymr',]] 'ksw', 'blk', 'kjp', 'shn', 'mnw', 'my', 'rki',
  -- Other Central and South-Eastern Asian abugidas
    --[['-cakm',]] 'ccp',
    --[['-khmr',]] 'km',
    --[['-thai',]] 'th',
    --[['-tale',]] 'tdd',
    --[['-lana',]] 'nod',
    --[['-laoo',]] 'lo',
    --[['-bali',]] 'ban-bali',
    --[['-java',]] 'jv-java',
    --[['-olck',]] 'sat',
    --[['-wara',]]
    --[['-pauc',]]
    --[['-mroo',]]
    --[['-medf',]]
    --[['-sunu',]]
    --[['-tnsa',]]
  -- American and European syllabaries
    --[['-cher',]] 'chr',
    --[['-osge',]] 'osa',
    --[['-cans',]] 'ike',  'ike-cans', 'iu',
    --[['-hmnp',]] 'hoc',
    --[['-goth',]] 'got',
    --[['-moon',]]
  -- African syllabaries
    --[['-tfng',]] 'tzm', 'zgh', 'shi-tfng', 'rif-tfng', 'sjs',
    --[['-ethi',]] 'tig', 'ti', 'am',
    --[['-berf',]] 'zag-berf',
    --[['-bass',]]
    --[['-osma',]]
    --[['-shaw',]]
    --[['-plrd',]]
  -- Hieroglyphic scripts
    --[['-egyd', '-egyh', '-egyp',]]
    --[['-hluw',]]
    --[['-mero','-merc',]]
    --[['-maya',]]
    --[['-nkdb',]]
    --[['-sgnw',]]
    --[['-visp',]]
  -- Asian syllabaries
    --[['-yiii',]] 'ii',
  -- Korean scripts (alphabet and sinograms)
    --[['-kore', '-hang', '-jamo',]] 'ko-kp', 'ko', 'ko-kr',
  -- Japanese scripts (syllabaries and sinograms)
    --[['-japn', '-hrkt', '-hira', '-kana',]] 'ja', 'ryu',
  -- Sinographic scripts (plus Bopomofo syllabary)
    --[['-hanb', '-hani', '-hans', '-hntl', '-hant', '-bopo',]]
    'zh', 'zh-cn', 'zh-sg', 'zh-mo', 'zh-hans', 'zh-hant', 'zh-tw', 'zh-hk', 'zh-my',
    'wuu-hant', 'wuu', 'wuu-hans',
    'hak', 'hak-hant', 'hak-hans',
    'lzh', 'zh-classical',
    'hsn',
    'yue', 'zh-yue', 'yue-hant', 'yue-hans',
    'cpx', 'cpx-hant', 'cpx-hans',
    'gan', 'gan-hant', 'gan-hans',
    'nan-hani', 'nan', 'nan-hant',
    'cdo', 'cdo-hant',
-- Other vertical scripts (that are rendered horizontally, when not rotated explicitly by style)
    --[['-mong',]] 'mnc-mong',
-- RTL scripts
  -- Hebrew abjads
    --[['-hebr',]] 'yi', 'ydd', 'yih', 'he', 'hbo',
  -- Arabic abjads
    --[['-arab', '-aran',]] 
    --[[ء]] -- [[ٴ]]
    --[[ئ]] 'ug-arab', 'ug',
    --[[ا]] 'ur', 'ary', 'ar', 'acq', 'uz-arab',
      --[[أ]] --[[ٱ]] --[[ٳ]] --[[ٲ]] --[[ا]] --[[آ]]
    --[[ب]] 'bqi', 'bsk', 'bgp' ,'bal', 'ms-arab',
      --[[ب]] --[[ٻ]] --[[ڀ]]
      --[[پ]] 'ps', 'pnb',
      --[[ت]] 'aeb-arab', 'aeb', 'azb',
      --[[ٺ]] --[[ٿ]] --[[ټ]] --[[ٽ]] --[[ٹ]]
    --[[ج]] 'arq', 'bcc',
      --[[ڃ]] --[[ڄ]] --[[چ]] --[[ڇ]] --[[ح]] --[[ځ]] --[[ڂ]] --[[څ]] --[[خ]]
    --[[د]] --[[ڋ]] --[[ڈ]] --[[ډ]] --[[ڊ]] --[[ڍ]] --[[ڎ]] --[[ڏ]] --[[ڐ]] --[[ذ]] --[[ڌ]]
    --[[ر]] 'bgn',
      --[[ڕ]] --[[ڒ]] --[[ڔ]] --[[ږ]] --[[ڗ]] --[[ڑ]] --[[ړ]] --[[ز]] --[[ڙ]] --[[ژ]]
    --[[س]] 'skr', 'skr-arab', 'sd',
      --[[ڛ]] --[[ښ]] --[[ڜ]]
      --[[ش]] 'apc', 'acm', 'ajp',
    --[[ص]] --[[ڝ]] --[[ڞ]] --[[ض]]
    --[[ط]] --[[ڟ]] --[[ظ]]
    --[[ع]] 'arb',
      --[[ڠ]] --[[غ]]
    --[[ڡ]]
      --[[ف]] 'fa-af', 'fa', 'prd',
      --[[ڢ]] --[[ڣ]] --[[ڤ]] --[[ڥ]] --[[ڦ]]
    --[[ق]] 'kk-arab', 'kk-cn',
      --[[ڧ]] --[[ڨ]]
    --[[ك]] 'ku-arab', 'kcn', 'kmr-arab',
      --[[ګ]] --[[ڮ]] --[[ڬ]] --[[ڭ]]
      --[[ک]] 'ks', 'ks-arab', 'pbt', 'khw', 'ckb', 'sdh',
      --[[ڪ]]
      --[[گ]] 'gju-arab', 'glk',
      --[[ڰ]] --[[ڱ]] --[[ڳ]] --[[ڲ]] --[[ڴ]]
    --[[ل]] 'ota', 'lrc', 'luz', 'lki',
      --[[ڵ]] --[[ڶ]] --[[ڷ]]
    --[[م]] 'mve', 'mzn', 'arz', 'pst',
    --[[ں]] --[[ن]] --[[ڼ]] --[[ڻ]] --[[ڽ]]
    --[[ۃ]]
      --[[ه]] 'ha-arab',
      --[[ہ]] 'hno',
      --[[ھ]] --[[ۂ]] --[[ە]] --[[ۀ]]
    --[[و]] 'wne',
      --[[ۄ]] --[[ۆ]] --[[ۅ]] --[[ۇ]] --[[ۈ]] --[[ۉ]]
    --[[ې]] --[[ۍ]] --[[ى]] --[[ي]] --[[ێ]] --[[ۑ]] --[[ے]]
      --[[ی]] 'pbu',
      --[[ۓ]]
  -- Other semitics abjads
    --[['-samr', '-armi']] 'arc',
    --[['-syrc', '-syre', '-syrj', '-syrn',]] 'syc',
    --[['-thaa', '-diak',]] 'dv',
    --[['-nkoo',]] 'nqo',
    --[['-adlm',]]
    --[['-rohg',]]
    --[['-yezi',]]
    --[['-orkh',]]
    --[['-hung',]]
    --[['-sidt',]]
    --[['-gara',]]
    --[['-ugar',]]
    --[['-cari',]]
    --[['-lyci',]]
    --[['-lydi',]]
    --[['-palm',]]
    --[['-sarb',]]
    --[['-nbat',]]
    --[['-narb',]]
    --[['-hatr',]]
    --[['-elym',]]
    --[['-prti',]]
    --[['-phli', '-phlp', '-phlv',]]
    --[['-avst',]]
    --[['-pssin']]
    --[['-pelm',]]
    --[['-chrs',]]
    --[['-mani',]]
    --[['-mand',]]
    --[['-sogo', '-sogd',]]
    --[['-xpeo',]] 'xpu',
    --[['-xsux',]] 'phn',
    --[['-pcun',]]
-- Additional language codes that still need to be sorted by native name can be temporarily placed
    
}

setmetatable(p, {
    quickTests = function()
        local s = {}
        for k, lang in pairs(p) do
            if type(k) ~= 'number' or k < 1 or k ~= math.floor(k)
            or type(lang) ~= 'string' or #lang < 2 or #lang > 16
            or (lang):find('^[a-z][%-0-9a-z]*[0-9a-z]$') ~= 1
            or s[lang] then
                return false, ': invalid sequence of distinct lowercase language codes at p[' .. tostring(k) .. '] = "' .. tostring(lang) .. '"'
            end
            s[lang] = true
        end
        return true
    end
})
--[=[ To test this module in the Lua console: -- must return true
=getmetatable(p).quickTests()
--]=]

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.