Content deleted Content added
per edit request; adds Tâi-lô romanization support |
Publishing User:Northern Moonlight's implementation of new fields to specify locale-specific character glyphs according to the IETF standard |
||
(One intermediate revision by the same user not shown) | |||
Line 109:
local usebrackets = 0 -- whether to have bracketed terms
local numargs = 0
local regionalvariant = nil
if args["out"] then
Line 170 ⟶ 171:
-- if also Tongyu pinyin use full name for Hanyu pinyin
labels["p"] = "Hanyu Pinyin"
end
-- specify traditional Chinese variants
if args["t_hk"] then
args["t"] = args["t_hk"]
regionalvariant = "HK"
elseif args["t_tw"] then
args["t"] = args["t_tw"]
regionalvariant = "TW"
end
Line 232 ⟶ 242:
if (ISOlang[part]) then
-- add span for language if needed
params = {["lang"] = ISOlang[part] .. (regionalvariant and "-" .. regionalvariant or "")}
val = mw.text.tag({name="span",attrs=params, content=val})
elseif (part == "l") then
local terms = ""
-- put individual, potentially comma-separated glosses in single
-- (first strip leading and trailing whitespace and quotes, including bold/italic markup)
for term in val:gmatch("[^;,]+") do
term =
terms = terms .. "'" .. term .. "', "
end
Line 244 ⟶ 255:
elseif (part == "tr") then
-- put translations in double quotes
-- (first strip leading and trailing spaces and quotes, including bold/italic markup)
val = mw.text.trim(val, "%s\"'")
val = """ .. val .. """
end
|