Module:Dir/RTL overrides : Différence entre versions

De Wiklou, le Wiki du Biclou
Aller à : navigation, rechercher
m
 
m (1 révision importée : Import du modèle self nécessaire à certains bandeaux de licences)
 
(Aucune différence)

Version actuelle datée du 11 janvier 2016 à 12:19

  • For testing the coherence and completeness of the language lists, look at the status shown in the base page of this Module:Dir, where you can run =getmetatable()p.quickTests() in the Lua console to see a detailed analysis.
  • For seeing the complete list of languages, tested with their direcionality defined here, look at the tests results table on Module talk:Multilingual description/sort/testcases.

local p = {}

--[==[
Basic input sequences: relative order or duplicates does not matter here (but the end of the self test displays them sorted and deduplicated),
but codes must be valid and belong to only one of the two sequences).

Any missing language code will be checked with mw.language.new(code):isRTL(), which is costly
in loaded resources (it can only check 20 languages at most including the content language)
So it is best to map all languages that are the most likely to be used.
--]==]

local rtlLangs = { 'aeb', 'ar', 'arc', 'arq', 'arz', 'azb', 'bcc', 'bgn', 'bqi', 'ckb', 'dv', 'fa', 'fa-af', 'glk', 'ha-arab', 'he', 'khw', 'kk-arab', 'kk-cn', 'ks', 'ks-arab', 'ku-arab', 'lrc', 'mzn', 'pnb', 'prd', 'ps', 'sd', 'ug', 'ug-arab', 'ur', 'uz-arab', 'ydd', 'yi' }

local ltrLangs = { 'aa', 'ab', 'ace', 'af', 'ak', 'aln', 'als', 'am', 'an', 'ang', 'anp', 'arn', 'ary', 'as', 'ast', 'av', 'avk', 'ay', 'az', 'ba', 'bar', 'bat-smg', 'bbc', 'bbc-latn', 'bcl', 'be', 'be-tarask', 'be-x-old', 'bg', 'bh', 'bho', 'bi', 'bjn', 'bm', 'bn', 'bo', 'bpy', 'br', 'brh', 'bs', 'bto', 'bu', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ce', 'ceb', 'ch', 'cho', 'chr', 'chy', 'co', 'cps', 'cr', 'crh', 'crh-cyrl', 'crh-latn', 'cs', 'csb', 'cu', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'de-formal', 'diq', 'dsb', 'dtp', 'dz', 'ee', 'egl', 'el', 'eml', 'en', 'en-ca', 'en-gb', 'en-ie', 'en-us', 'eo', 'es', 'et', 'eu', 'ext', 'ff', 'fi', 'fil', 'fit', 'fiu-vro', 'fj', 'fo', 'fr', 'frc', 'fro', 'frp', 'frr', 'fur', 'fy', 'ga', 'gag', 'gan', 'gan-hans', 'gan-hant', 'gcf', 'gd', 'gl', 'gn', 'gom-latn', 'got', 'grc', 'gsw', 'gu', 'gv', 'ha', 'hak', 'haw', 'hi', 'hif', 'hif-deva', 'hif-latn', 'hil', 'ho', 'hr', 'hrx', 'hsb', 'ht', 'hu', 'hy', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ike-cans', 'ike-latn', 'ilo', 'inh', 'io', 'is', 'it', 'iu', 'ja', 'jam', 'jbo', 'jut', 'jv', 'ka', 'kaa', 'kab', 'kbd', 'kbd-cyrl', 'kbd-latn', 'kg', 'ki', 'kiu', 'kj', 'kk', 'kk-cyrl', 'kk-kz', 'kk-latn', 'kk-tr', 'kl', 'km', 'kn', 'ko', 'koi', 'ko-kp', 'ko-kr', 'kr', 'krc', 'kri', 'krj', 'ks-deva', 'ksh', 'ku', 'ku-latn', 'kv', 'kw', 'ky', 'la', 'lad', 'lb', 'lbe', 'lez', 'lfn', 'lg', 'li', 'lij', 'liv', 'lmo', 'ln', 'lo', 'loz', 'lt', 'ltg', 'lus', 'lv', 'lzh', 'lzz', 'mai', 'map-bms', 'mdf', 'mg', 'mh', 'mhr', 'mi', 'min', 'mk', 'ml', 'mn', 'mo', 'mr', 'mrj', 'ms', 'mt', 'mus', 'mwl', 'my', 'myv', 'na', 'nah', 'nan', 'nap', 'nb', 'nds', 'nds-nl', 'ne', 'new', 'ng', 'niu', 'nl', 'nl-informal', 'nn', 'no', 'nov', 'nrm', 'nso', 'nv', 'ny', 'oc', 'om', 'or', 'os', 'pa', 'pag', 'pam', 'pap', 'pcd', 'pdc', 'pdt', 'pfl', 'pi', 'pih', 'pl', 'pms', 'pnt', 'prg', 'pt', 'pt-br', 'pt-cv', 'pt-pt', 'qu', 'qug', 'rgn', 'rif', 'rm', 'rmy', 'rn', 'ro', 'roa-rup', 'roa-tara', 'ru', 'rue', 'rup', 'ruq', 'ruq-cyrl', 'ruq-latn', 'rw', 'sa', 'sah', 'sat', 'sc', 'scd', 'scn', 'sco', 'sdc', 'se', 'sei', 'ses', 'sg', 'sgs', 'sh', 'sh-cyrl', 'shi', 'shi-latn', 'shi-tfng', 'sh-latn', 'si', 'simple', 'sk', 'sl', 'sli', 'sm', 'sma', 'sn', 'so', 'sq', 'sr', 'sr-cyrl', 'sr-ec', 'sr-el', 'sr-latn', 'srn', 'ss', 'st', 'stq', 'su', 'sv', 'sw', 'szl', 'ta', 'tcy', 'te', 'tet', 'tg', 'tg-cyrl', 'tg-latn', 'th', 'ti', 'tk', 'tl', 'tly', 'tn', 'to', 'tokipona', 'tpi', 'tr', 'tru', 'ts', 'tt', 'tt-cyrl', 'tt-latn', 'tum', 'tw', 'ty', 'tyv', 'tzm', 'udm', 'ug-latn', 'uk', 'uz', 'uz-cyrl', 'uz-latn', 've', 'vec', 'vep', 'vi', 'vls', 'vmf', 'vo', 'vot', 'vro', 'wa', 'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'yo', 'yue', 'za', 'zea', 'zh', 'zh-classical', 'zh-cn', 'zh-hans', 'zh-hant', 'zh-hk', 'zh-min-nan', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw', 'zh-wuu', 'zh-yue', 'zu' }

-- Build the inverted map of languages to direction returned by this data module (fast but unchecked)
for _, lang in ipairs(rtlLangs) do p[lang] = true  end
for _, lang in ipairs(ltrLangs) do p[lang] = false end
p[true] = rtlLangs
p[false] = ltrLangs

return p