Module:frp-IPA: difference between revisions

Content deleted Content added
No edit summary
split references between alt L2 and pron L2
Line 118:
 
local function gather_data(data, args, require_pron)
-- reference
if args.sources or args.cf or args.note then
data.ref, data.specified = require("Module:frp-IPA/ref").make_ref(args.sources, args.cf, args.note)
else
data.ref, data.specified = "", {}
end
for _, a in ipairs(codes) do
if args[a] and args[a] ~= "" then
Line 129 ⟶ 123:
for term in mw.text.gsplit(args[a], ";", true) do
local loc_data = parse(term, a, require_pron)
if loc_data.ref and not args[loc_data.ref] and not data.specified[loc_data.ref] then
error("Reference used but not specified: " .. loc_data.ref)
end
table.insert(data[a], loc_data)
if loc_data.pron then
Line 249 ⟶ 240:
local show = {}
local hide = {}
for _, a in ipairs(codes) do
if data[a] and data[a].has_pron then
Line 260 ⟶ 252:
.. (term.ref and "<sup>" .. term.ref .. "</sup>" or "")
record_locs(processed, term, a)
end
end
end
Line 286 ⟶ 281:
end
end
end
-- reference
if args.sources or args.cf or args.note then
data.ref, data.specified = require("Module:frp-IPA/ref").make_ref(args.sources, args.cf, args.note)
else
data.ref, data.specified = "", {}
end
return '<div class="vsSwitcher" data-toggle-category="pronunciations">'
Line 308 ⟶ 309:
local show = {}
local hide = {}
for _, a in ipairs(codes) do
if data[a] and data[a].has_ortho then
Line 317 ⟶ 319:
.. (term.ref and "<sup>" .. term.ref .. "</sup>" or "")
record_locs(processed, term, a)
end
end
Line 337 ⟶ 342:
end
end
end
return '<div class="vsSwitcher" data-toggle-category="alternative forms">'
Line 344 ⟶ 355:
.. '\n</div><div class="vsHide">\n'
.. table.concat(hide, '\n')
.. '</div></div>'
end