Module:IPA/data/export: Difference between revisions

Content deleted Content added
Created page with 'require('strict') local rawData = mw.title.getCurrentTitle().subpageText == 'sandbox' and mw.loadData('Module:IPA/data/sandbox') or mw.loadData('Module:IPA/data') local data = {} local function getNameAndLink(code) local res = require('Module:Lang')._name_from_tag({ code, link = 'yes' }) local name = res:match('([^%[|%]]+)%]%]$') local link = res:match('^%[%[([^|%]]+)') return name, link end local function augmentData(lect) if lect.name and not le...'
 
rm diaCode
 
(5 intermediate revisions by 2 users not shown)
Line 45:
for diaCode, dialect in pairs(lang.dialects) do
if not dialect.aliasOf then
aliaseslocal diaAliases = aliases[diaCode],
if dialect.isVariant then
diaCode = diaCode:lower()
Line 50 ⟶ 51:
local diaData = {
code = code .. '-' .. diaCode,
diaCodealiases = diaCodediaAliases,
aliases = aliases[diaCode],
name = dialect.name,
text = dialect.text,
Line 60:
augmentData(diaData)
table.insert(data, diaData)
langData.dialects = langData.dialects or {}
table.insert(langData.dialects, diaCode)
end
end