-- lx-bundle:true

-- This file is part of Lx, created by Liqube <www.liqube.com>
-- Copyright Liqube Audio. All rights reserved.
-- Lx Interim License. See LICENSE for details.

--- Language metadata tables
-- Based on Resonic's Language.cpp by Liqube Audio
-- @module data

local plural = require("core.i18n.plural")

local data = {}

-- languages[base_code] = {
--   name   = "English",
--   forms   = 2,
--   resolver = "one_other_n1", -- symbolic id resolved by language_rules.lua
-- }
data.languages = {
  af      = { name = "Afrikaans",               forms = 2, resolver = plural.one_other_n1 },
  ak      = { name = "Akan",                    forms = 2, resolver = plural.one_other_gt1 },
  am      = { name = "Amharic",                 forms = 2, resolver = plural.one_other_gt1 },
  ar      = { name = "Arabic",                  forms = 6, resolver = plural.arabic },
  ar_001  = { name = "Modern Standard Arabic",  forms = 6, resolver = plural.arabic },
  ars     = { name = "Najdi Arabic",            forms = 6, resolver = plural.arabic },
  as      = { name = "Assamese",                forms = 2, resolver = plural.one_other_gt1 },
  asa     = { name = "Asu",                     forms = 2, resolver = plural.one_other_n1 },
  ast     = { name = "Asturian",                forms = 2, resolver = plural.one_other_n1 },
  az      = { name = "Azerbaijani",             forms = 2, resolver = plural.one_other_n1 },
  be      = { name = "Belarusian",              forms = 3, resolver = plural.one_few_other_russian },
  bem     = { name = "Bemba",                   forms = 2, resolver = plural.one_other_n1 },
  bez     = { name = "Bena",                    forms = 2, resolver = plural.one_other_n1 },
  bg      = { name = "Bulgarian",               forms = 2, resolver = plural.one_other_n1 },
  bh      = { name = "Bihari",                  forms = 2, resolver = plural.one_other_gt1 },
  bm      = { name = "Bambara",                 forms = 1, resolver = plural.none },
  bn      = { name = "Bangla",                  forms = 2, resolver = plural.one_other_gt1 },
  bo      = { name = "Tibetan",                 forms = 1, resolver = plural.none },
  br      = { name = "Breton",                  forms = 5, resolver = plural.breton },
  brx     = { name = "Bodo",                    forms = 2, resolver = plural.one_other_n1 },
  bs      = { name = "Bosnian",                 forms = 3, resolver = plural.one_few_other_russian },
  ca      = { name = "Catalan",                 forms = 2, resolver = plural.one_other_n1 },
  ce      = { name = "Chechen",                 forms = 2, resolver = plural.one_other_n1 },
  cgg     = { name = "Chiga",                   forms = 2, resolver = plural.one_other_n1 },
  chr     = { name = "Cherokee",                forms = 2, resolver = plural.one_other_n1 },
  ckb     = { name = "Central Kurdish",         forms = 2, resolver = plural.one_other_n1 },
  cs      = { name = "Czech",                   forms = 3, resolver = plural.one_few_other_slovak },
  cy      = { name = "Welsh",                   forms = 6, resolver = plural.welsh },
  da      = { name = "Danish",                  forms = 2, resolver = plural.one_other_n1 },
  de      = { name = "German",                  forms = 2, resolver = plural.one_other_n1 },
  de_at   = { name = "Austrian German",         forms = 2, resolver = plural.one_other_n1 },
  de_ch   = { name = "Swiss High German",       forms = 2, resolver = plural.one_other_n1 },
  dsb     = { name = "Lower Sorbian",           forms = 4, resolver = plural.one_two_few_other_sorbian },
  dv      = { name = "Divehi",                  forms = 2, resolver = plural.one_other_n1 },
  dz      = { name = "Dzongkha",                forms = 1, resolver = plural.none },
  ee      = { name = "Ewe",                     forms = 2, resolver = plural.one_other_n1 },
  el      = { name = "Greek",                   forms = 2, resolver = plural.one_other_n1 },
  en      = { name = "English",                 forms = 2, resolver = plural.one_other_n1 },
  en_au   = { name = "Australian English",      forms = 2, resolver = plural.one_other_n1 },
  en_ca   = { name = "Canadian English",        forms = 2, resolver = plural.one_other_n1 },
  en_gb   = { name = "British English",         forms = 2, resolver = plural.one_other_n1 },
  en_us   = { name = "American English",        forms = 2, resolver = plural.one_other_n1 },
  eo      = { name = "Esperanto",               forms = 2, resolver = plural.one_other_n1 },
  es      = { name = "Spanish",                 forms = 2, resolver = plural.one_other_n1 },
  es_419  = { name = "Latin American Spanish",  forms = 2, resolver = plural.one_other_n1 },
  es_es   = { name = "European Spanish",        forms = 2, resolver = plural.one_other_n1 },
  es_mx   = { name = "Mexican Spanish",         forms = 2, resolver = plural.one_other_n1 },
  et      = { name = "Estonian",                forms = 2, resolver = plural.one_other_n1 },
  eu      = { name = "Basque",                  forms = 2, resolver = plural.one_other_n1 },
  fa      = { name = "Persian",                 forms = 2, resolver = plural.one_other_gt1 },
  fa_af   = { name = "Dari",                    forms = 2, resolver = plural.one_other_gt1 },
  ff      = { name = "Fulah",                   forms = 2, resolver = plural.one_other_gt1 },
  fi      = { name = "Finnish",                 forms = 2, resolver = plural.one_other_n1 },
  fil     = { name = "Filipino",                forms = 2, resolver = plural.one_other_tagalog },
  fo      = { name = "Faroese",                 forms = 2, resolver = plural.one_other_n1 },
  fr      = { name = "French",                  forms = 2, resolver = plural.one_other_gt1 },
  fr_ca   = { name = "Canadian French",         forms = 2, resolver = plural.one_other_gt1 },
  fr_ch   = { name = "Swiss French",            forms = 2, resolver = plural.one_other_gt1 },
  fur     = { name = "Friulian",                forms = 2, resolver = plural.one_other_n1 },
  fy      = { name = "Western Frisian",         forms = 2, resolver = plural.one_other_n1 },
  ga      = { name = "Irish",                   forms = 5, resolver = plural.irish },
  gd      = { name = "Scottish Gaelic",         forms = 4, resolver = plural.scottish },
  gl      = { name = "Galician",                forms = 2, resolver = plural.one_other_n1 },
  gsw     = { name = "Swiss German",            forms = 2, resolver = plural.one_other_n1 },
  gu      = { name = "Gujarati",                forms = 2, resolver = plural.one_other_gt1 },
  guw     = { name = "Gun",                     forms = 2, resolver = plural.one_other_gt1 },
  gv      = { name = "Manx",                    forms = 4, resolver = plural.one_two_few_other_manx },
  ha      = { name = "Hausa",                   forms = 2, resolver = plural.one_other_n1 },
  haw     = { name = "Hawaiian",                forms = 2, resolver = plural.one_other_n1 },
  he      = { name = "Hebrew",                  forms = 4, resolver = plural.one_two_many_other_hebrew },
  hi      = { name = "Hindi",                   forms = 2, resolver = plural.one_other_gt1 },
  hr      = { name = "Croatian",                forms = 3, resolver = plural.one_few_other_russian },
  hsb     = { name = "Upper Sorbian",           forms = 4, resolver = plural.one_two_few_other_sorbian },
  hu      = { name = "Hungarian",               forms = 2, resolver = plural.one_other_n1 },
  hy      = { name = "Armenian",                forms = 2, resolver = plural.one_other_gt1 },
  id      = { name = "Indonesian",              forms = 1, resolver = plural.none },
  ig      = { name = "Igbo",                    forms = 1, resolver = plural.none },
  ii      = { name = "Sichuan Yi",              forms = 1, resolver = plural.none },
  ["in"]  = { name = "Indonesian",              forms = 1, resolver = plural.none },
  is      = { name = "Icelandic",               forms = 2, resolver = plural.one_other_icelandic },
  it      = { name = "Italian",                 forms = 2, resolver = plural.one_other_n1 },
  iu      = { name = "Inuktitut",               forms = 3, resolver = plural.one_two_other },
  iw      = { name = "Hebrew",                  forms = 4, resolver = plural.one_two_many_other_hebrew },
  ja      = { name = "Japanese",                forms = 1, resolver = plural.none },
  jbo     = { name = "Lojban",                  forms = 1, resolver = plural.none },
  jgo     = { name = "Ngomba",                  forms = 2, resolver = plural.one_other_n1 },
  ji      = { name = "Yiddish",                 forms = 2, resolver = plural.one_other_n1 },
  jmc     = { name = "Machame",                 forms = 2, resolver = plural.one_other_n1 },
  jv      = { name = "Javanese",                forms = 1, resolver = plural.none },
  jw      = { name = "Javanese",                forms = 1, resolver = plural.none },
  ka      = { name = "Georgian",                forms = 2, resolver = plural.one_other_n1 },
  kab     = { name = "Kabyle",                  forms = 2, resolver = plural.one_other_gt1 },
  kaj     = { name = "Jju",                     forms = 2, resolver = plural.one_other_n1 },
  kcg     = { name = "Tyap",                    forms = 2, resolver = plural.one_other_n1 },
  kde     = { name = "Makonde",                 forms = 1, resolver = plural.none },
  kea     = { name = "Kabuverdianu",            forms = 1, resolver = plural.none },
  kk      = { name = "Kazakh",                  forms = 2, resolver = plural.one_other_n1 },
  kkj     = { name = "Kako",                    forms = 2, resolver = plural.one_other_n1 },
  kl      = { name = "Kalaallisut",             forms = 2, resolver = plural.one_other_n1 },
  km      = { name = "Khmer",                   forms = 1, resolver = plural.none },
  kn      = { name = "Kannada",                 forms = 2, resolver = plural.one_other_gt1 },
  ko      = { name = "Korean",                  forms = 1, resolver = plural.none },
  ks      = { name = "Kashmiri",                forms = 2, resolver = plural.one_other_n1 },
  ksb     = { name = "Shambala",                forms = 2, resolver = plural.one_other_n1 },
  ksh     = { name = "Colognian",               forms = 3, resolver = plural.zero_one_other },
  ku      = { name = "Kurdish",                 forms = 2, resolver = plural.one_other_n1 },
  kw      = { name = "Cornish",                 forms = 3, resolver = plural.one_two_other },
  ky      = { name = "Kyrgyz",                  forms = 2, resolver = plural.one_other_n1 },
  lag     = { name = "Langi",                   forms = 3, resolver = plural.zero_one_other },
  lb      = { name = "Luxembourgish",           forms = 2, resolver = plural.one_other_n1 },
  lg      = { name = "Ganda",                   forms = 2, resolver = plural.one_other_n1 },
  lkt     = { name = "Lakota",                  forms = 1, resolver = plural.none },
  ln      = { name = "Lingala",                 forms = 2, resolver = plural.one_other_gt1 },
  lo      = { name = "Lao",                     forms = 1, resolver = plural.none },
  lt      = { name = "Lithuanian",              forms = 3, resolver = plural.one_few_other_lithuanian },
  lv      = { name = "Latvian",                 forms = 3, resolver = plural.zero_one_other_latvian },
  mas     = { name = "Masai",                   forms = 2, resolver = plural.one_other_n1 },
  mg      = { name = "Malagasy",                forms = 2, resolver = plural.one_other_gt1 },
  mgo     = { name = "Meta'",                   forms = 2, resolver = plural.one_other_n1 },
  mk      = { name = "Macedonian",              forms = 2, resolver = plural.one_other_macedonian },
  ml      = { name = "Malayalam",               forms = 2, resolver = plural.one_other_gt1 },
  mn      = { name = "Mongolian",               forms = 2, resolver = plural.one_other_n1 },
  mo      = { name = "Moldavian",               forms = 3, resolver = plural.one_few_other_romanian },
  mr      = { name = "Marathi",                 forms = 2, resolver = plural.one_other_gt1 },
  ms      = { name = "Malay",                   forms = 1, resolver = plural.none },
  mt      = { name = "Maltese",                 forms = 4, resolver = plural.one_few_many_other_maltese },
  my      = { name = "Burmese",                 forms = 1, resolver = plural.none },
  nah     = { name = "Nahuatl",                 forms = 2, resolver = plural.one_other_n1 },
  naq     = { name = "Nama",                    forms = 3, resolver = plural.one_two_other },
  nb      = { name = "Norwegian Bokmal",        forms = 2, resolver = plural.one_other_n1 },
  nd      = { name = "North Ndebele",           forms = 2, resolver = plural.one_other_n1 },
  ne      = { name = "Nepali",                  forms = 2, resolver = plural.one_other_n1 },
  nl      = { name = "Dutch",                   forms = 2, resolver = plural.one_other_n1 },
  nl_be   = { name = "Flemish",                 forms = 2, resolver = plural.one_other_n1 },
  nn      = { name = "Norwegian Nynorsk",       forms = 2, resolver = plural.one_other_n1 },
  nnh     = { name = "Ngiemboon",               forms = 2, resolver = plural.one_other_n1 },
  no      = { name = "Norwegian",               forms = 2, resolver = plural.one_other_n1 },
  nqo     = { name = "N’Ko",                    forms = 1, resolver = plural.none },
  nr      = { name = "South Ndebele",           forms = 2, resolver = plural.one_other_n1 },
  nso     = { name = "Northern Sotho",          forms = 2, resolver = plural.one_other_gt1 },
  ny      = { name = "Nyanja",                  forms = 2, resolver = plural.one_other_n1 },
  nyn     = { name = "Nyankole",                forms = 2, resolver = plural.one_other_n1 },
  om      = { name = "Oromo",                   forms = 2, resolver = plural.one_other_n1 },
  ["or"]  = { name = "Odia",                    forms = 2, resolver = plural.one_other_n1 },
  ["os"]  = { name = "Ossetic",                 forms = 2, resolver = plural.one_other_n1 },
  pa      = { name = "Punjabi",                 forms = 2, resolver = plural.one_other_gt1 },
  pap     = { name = "Papiamento",              forms = 2, resolver = plural.one_other_n1 },
  pl      = { name = "Polish",                  forms = 3, resolver = plural.one_few_other_polish },
  prg     = { name = "Prussian",                forms = 3, resolver = plural.zero_one_other_latvian },
  ps      = { name = "Pashto",                  forms = 2, resolver = plural.one_other_n1 },
  pt      = { name = "Portuguese",              forms = 2, resolver = plural.one_other_gt1 },
  pt_br   = { name = "Brazilian Portuguese",    forms = 2, resolver = plural.one_other_gt1 },
  pt_pt   = { name = "European Portuguese",     forms = 2, resolver = plural.one_other_gt1 },
  rm      = { name = "Romansh",                 forms = 2, resolver = plural.one_other_n1 },
  ro      = { name = "Romanian",                forms = 3, resolver = plural.one_few_other_romanian },
  ro_md   = { name = "Moldavian",               forms = 3, resolver = plural.one_few_other_romanian },
  rof     = { name = "Rombo",                   forms = 2, resolver = plural.one_other_n1 },
  ru      = { name = "Russian",                 forms = 3, resolver = plural.one_few_other_russian },
  rwk     = { name = "Rwa",                     forms = 2, resolver = plural.one_other_n1 },
  sah     = { name = "Sakha",                   forms = 1, resolver = plural.none },
  saq     = { name = "Samburu",                 forms = 2, resolver = plural.one_other_n1 },
  sdh     = { name = "Southern Kurdish",        forms = 2, resolver = plural.one_other_n1 },
  se      = { name = "Northern Sami",           forms = 3, resolver = plural.one_two_other },
  seh     = { name = "Sena",                    forms = 2, resolver = plural.one_other_n1 },
  ses     = { name = "Koyraboro Senni",         forms = 1, resolver = plural.none },
  sg      = { name = "Sango",                   forms = 1, resolver = plural.none },
  sh      = { name = "Serbo Croatian",          forms = 3, resolver = plural.one_few_other_russian },
  shi     = { name = "Tachelhit",               forms = 3, resolver = plural.one_few_other_tachelhit },
  si      = { name = "Sinhala",                 forms = 2, resolver = plural.one_other_gt1 },
  sk      = { name = "Slovak",                  forms = 3, resolver = plural.one_few_other_slovak },
  sl      = { name = "Slovenian",               forms = 4, resolver = plural.one_two_few_other_sorbian },
  sma     = { name = "Southern Sami",           forms = 3, resolver = plural.one_two_other },
  smi     = { name = "Sami",                    forms = 3, resolver = plural.one_two_other },
  smj     = { name = "Lule Sami",               forms = 3, resolver = plural.one_two_other },
  smn     = { name = "Inari Sami",              forms = 3, resolver = plural.one_two_other },
  sms     = { name = "Skolt Sami",              forms = 3, resolver = plural.one_two_other },
  sn      = { name = "Shona",                   forms = 2, resolver = plural.one_other_n1 },
  so      = { name = "Somali",                  forms = 2, resolver = plural.one_other_n1 },
  sq      = { name = "Albanian",                forms = 2, resolver = plural.one_other_n1 },
  sr      = { name = "Serbian",                 forms = 3, resolver = plural.one_few_other_russian },
  ss      = { name = "Swati",                   forms = 2, resolver = plural.one_other_n1 },
  ssy     = { name = "Saho",                    forms = 2, resolver = plural.one_other_n1 },
  st      = { name = "Southern Sotho",          forms = 2, resolver = plural.one_other_n1 },
  sv      = { name = "Swedish",                 forms = 2, resolver = plural.one_other_n1 },
  sw      = { name = "Swahili",                 forms = 2, resolver = plural.one_other_n1 },
  sw_cd   = { name = "Congo Swahili",           forms = 2, resolver = plural.one_other_n1 },
  syr     = { name = "Syriac",                  forms = 2, resolver = plural.one_other_n1 },
  ta      = { name = "Tamil",                   forms = 2, resolver = plural.one_other_n1 },
  te      = { name = "Telugu",                  forms = 2, resolver = plural.one_other_n1 },
  teo     = { name = "Teso",                    forms = 2, resolver = plural.one_other_n1 },
  th      = { name = "Thai",                    forms = 1, resolver = plural.none },
  ti      = { name = "Tigrinya",                forms = 2, resolver = plural.one_other_gt1 },
  tig     = { name = "Tigre",                   forms = 2, resolver = plural.one_other_n1 },
  tk      = { name = "Turkmen",                 forms = 2, resolver = plural.one_other_n1 },
  tl      = { name = "Tagalog",                 forms = 2, resolver = plural.one_other_tagalog },
  tn      = { name = "Tswana",                  forms = 2, resolver = plural.one_other_n1 },
  to      = { name = "Tongan",                  forms = 1, resolver = plural.none },
  tr      = { name = "Turkish",                 forms = 2, resolver = plural.one_other_n1 },
  ts      = { name = "Tsonga",                  forms = 2, resolver = plural.one_other_n1 },
  tzm     = { name = "Central Atlas Tamazight", forms = 2, resolver = plural.one_other_tamazight },
  ug      = { name = "Uyghur",                  forms = 2, resolver = plural.one_other_n1 },
  uk      = { name = "Ukrainian",               forms = 3, resolver = plural.one_few_other_russian },
  ur      = { name = "Urdu",                    forms = 2, resolver = plural.one_other_n1 },
  uz      = { name = "Uzbek",                   forms = 2, resolver = plural.one_other_n1 },
  ve      = { name = "Venda",                   forms = 2, resolver = plural.one_other_n1 },
  vi      = { name = "Vietnamese",              forms = 1, resolver = plural.none },
  vo      = { name = "Volapuk",                 forms = 2, resolver = plural.one_other_n1 },
  vun     = { name = "Vunjo",                   forms = 2, resolver = plural.one_other_n1 },
  wa      = { name = "Walloon",                 forms = 2, resolver = plural.one_other_gt1 },
  wae     = { name = "Walser",                  forms = 2, resolver = plural.one_other_n1 },
  wo      = { name = "Wolof",                   forms = 1, resolver = plural.none },
  xh      = { name = "Xhosa",                   forms = 2, resolver = plural.one_other_n1 },
  xog     = { name = "Soga",                    forms = 2, resolver = plural.one_other_n1 },
  yi      = { name = "Yiddish",                 forms = 2, resolver = plural.one_other_n1 },
  yo      = { name = "Yoruba",                  forms = 1, resolver = plural.none },
  yue     = { name = "Cantonese",               forms = 1, resolver = plural.none },
  zh      = { name = "Chinese",                 forms = 1, resolver = plural.none },
  zh_hans = { name = "Simplified Chinese",      forms = 1, resolver = plural.none },
  zh_hant = { name = "Traditional Chinese",     forms = 1, resolver = plural.none },
  zu      = { name = "Zulu",                    forms = 2, resolver = plural.one_other_gt1 },
}

-- rtl_codes[code] = true
data.rtl_codes = {
  -- https://en.wikipedia.org/wiki/Right-to-left#RTL_Wikipedia_languages
  ar=true, arc=true, bcc=true, bqi=true, ckb=true, dv=true, fa=true, glk=true, he=true, ks=true, lrc=true,
  mzn=true, pnb=true, ps=true, sd=true, ug=true, ur=true, yi=true, nqo=true,
  -- https://github.com/i18next/i18next/blob/ee3afd8e5d958e8d703a208194e59fa5228165fd/src/i18next.js#L257-L262
  shu=true, sqr=true, ssh=true, xaa=true, yhd=true, yud=true, aao=true, abh=true, abv=true, acm=true,
  acq=true, acw=true, acx=true, acy=true, adf=true, ads=true, aeb=true, aec=true, afb=true, ajp=true,
  apc=true, apd=true, arb=true, arq=true, ars=true, ary=true, arz=true, auz=true, avl=true, ayh=true,
  ayl=true, ayn=true, ayp=true, bbz=true, pga=true, iw=true, pbt=true, pbu=true, pst=true, prp=true,
  prd=true, ydd=true, yds=true, yih=true, ji=true, hbo=true, men=true, xmn=true, jpr=true, peo=true,
  pes=true, prs=true, sam=true,
}

return data
