Module:IPA and Module:IPA/sandbox: Difference between pages
(Difference between pages)
imported>Nardog bugfixes |
imported>Nardog mNo edit summary |
||
| Line 68: | Line 68: | ||
local regionCode = s:match('%-(.+)') | local regionCode = s:match('%-(.+)') | ||
local isPrivate = regionCode and regionCode:sub(1, 2) == 'x-' | local isPrivate = regionCode and regionCode:sub(1, 2) == 'x-' | ||
if regionCode and not isPrivate and #regionCode < 4 then | |||
regionCode = regionCode:upper() | |||
end | |||
return langCode, regionCode, isPrivate | return langCode, regionCode, isPrivate | ||
end | end | ||
| Line 96: | Line 99: | ||
-- Guide-linking mode | -- Guide-linking mode | ||
if args[2] and args[2] ~= '' then | if args[2] and args[2] ~= '' then | ||
local data = mw.loadData('Module:IPA/data') | local data = mw.loadData('Module:IPA/data/sandbox') | ||
local isGeneric = args.generic == 'yes' | local isGeneric = args.generic == 'yes' | ||
s = args[2] | s = args[2] | ||
| Line 102: | Line 105: | ||
local langData = data.langs[langCode] or {} | local langData = data.langs[langCode] or {} | ||
if regionCode then | if regionCode then | ||
if langData.dialects and langData.dialects[regionCode] then | if langData.dialects and langData.dialects[regionCode] then | ||
-- Overwrite language data with the dialect's | -- Overwrite language data with the dialect's | ||
| Line 196: | Line 196: | ||
table.insert(ret, mw.getCurrentFrame():extensionTag({ | table.insert(ret, mw.getCurrentFrame():extensionTag({ | ||
name = 'templatestyles', | name = 'templatestyles', | ||
args = { src = 'Module:IPA/styles.css' } | args = { src = 'Module:IPA/sandbox/styles.css' } | ||
})) | })) | ||
end | end | ||