Content deleted Content added
HTML `lang` and `title` |
added custom label param |
||
(One intermediate revision by the same user not shown) | |||
Line 13:
-- Helper function to parse boolean parameters
local function isFalse(value)
if value == "no" or value == "n" or value == "false" or value == "0" or value == "off" or value == "none" then
return true
else
return false
local function parseBoolean(value, default)
if value == nil then
Line 20 ⟶ 28:
if value == "yes" or value == "y" or value == "true" or value == "1" or value == "on" then
return true
elseif isFalse(value
return false
end
Line 49 ⟶ 57:
local link = parseBoolean(args["link"], true)
local lead = parseBoolean(args["lead"], true)
local label = args["label"]
local labelOnly = parseBoolean(args["label-only"], true)
▲ end
local output = {}
local parts = {}
if
if not isFalse(label) then
table.insert(output, "[[Crimean Tatar language|Crimean Tatar]]: ")▼
elseif lead and not link then▼
else▼
▲ table.insert(output, "Crimean Tatar: ")
end
elseif lead then
if link then
table.insert(output, "[[Crimean Tatar language|Crimean Tatar]]: ")
else
table.insert(output, "Crimean Tatar: ")
end
end
local spannedLatin = "<span title=\"Crimean Tatar-language text\" lang=\"crh-Latn\">" .. latinText .. "</span>"▼
▲ if lead and not labelOnly and link then
-- elseif label and isFalse(label) then
table.insert(parts, "[[Latin alphabet|Latin]]: ''" .. spannedLatin .. "''")▼
-- do return end
elseif lead and not labelOnly and link then▼
-- elseif lead and link then
table.insert(parts, "Latin: ''" .. spannedLatin .. "''")▼
▲ else
▲ table.insert(parts, "''" .. spannedLatin .. "''")
-- table.insert(output, "Crimean Tatar: ")
▲ end
-- end
if latinText then
▲
if lead and not labelOnly and link then
▲ table.insert(parts, "[[Latin alphabet|Latin]]: ''" .. spannedLatin .. "''")
▲ elseif lead and not labelOnly and link then
▲ table.insert(parts, "Latin: ''" .. spannedLatin .. "''")
else
table.insert(parts, "''" .. spannedLatin .. "''")
▲ end
end
if cyrillicText then
|