Module:Wikt-lang/comparison
Appearance
Comparison of codes with name difference
[edit]Language code | Wikitionary name | English Wikipedia name |
---|---|---|
aaq | Penobscot | Eastern Abnaki |
abe | Abenaki | Western Abnaki |
ajp | South Levantine Arabic | South Levantine Arabic |
apc | North Levantine Arabic | Levantine Arabic |
arb | Modern Standard Arabic | Standard Arabic |
cel-x-bryproto | Proto-Brythonic | Error: unrecognized private tag: bryproto |
cu | Old Church Slavonic | Church Slavonic |
egy | Egyptian | Ancient Egyptian |
frp | Franco-Provençal | Arpitan |
gmw-x-proto | Proto-West Germanic | Error: unrecognized private tag: proto |
grk-x-proto | Proto-Hellenic | Proto-Greek |
ine-x-bsproto | Proto-Balto-Slavic | Error: unrecognized private tag: bsproto |
moe | Cree | Innu |
mul | Translingual | multiple |
nds-de | German Low German | Low German |
non-x-proto | Proto-Norse | Error: unrecognized private tag: proto |
poz-x-polproto | Proto-Nuclear Polynesian | Error: unrecognized private tag: polproto |
rw | Rwanda-Rundi | Kinyarwanda |
tts | Isan | Northeastern Thai |
xlu | Luwian | Cuneiform Luwian |
zle-x-ort | Old Ruthenian | Error: unrecognized private tag: ort |
require('strict')
local p = {}
local function get_test_patterns(main)
local data = require('Module:Wikt-lang/data/sandbox')
local language_codes = {}
if main then
for code, values in pairs(data["languages"]) do
table.insert(language_codes, {code, values.Wiktionary_name})
end
end
local function comp(a, b)
return a[1] < b[1]
end
table.sort(language_codes, comp)
return language_codes
end
function p.main(frame)
local wiktionary_test_patterns = get_test_patterns(true)
local name_from_tag = require('Module:Lang')._name_from_tag
local wikitable = {}
local header = '{|class="wikitable"\n|+\n! Language code\n! Wikitionary name\n! English Wikipedia name\n|-\n'
table.insert(wikitable, header)
local row = '! scope="row" | %s\n | %s\n | %s\n|-\n'
for i = 1, #wiktionary_test_patterns do
local code = wiktionary_test_patterns[i][1]
local wiktionary_name = wiktionary_test_patterns[i][2]
local en_wiki_name = name_from_tag({code})
if wiktionary_name then
table.insert(wikitable, string.format(row, code, wiktionary_name, en_wiki_name))
end
end
table.insert(wikitable, "|}")
return table.concat(wikitable)
end
return p