Module:Flagg: Difference between revisions

Content deleted Content added
mNo edit summary
Separate "pthe" and "nthe"
Line 55:
end
local yn_map = {[""]=0; ["0"]=0; ["no"]=0; ["n"]=0; ["1"]=1; ["yes"]=1; ["y"]=1}
local thefthe = (args["pthe"] and yn_map[args["pthe"]]~=0) or (args["the"] and yn_map[args["the"]]~=0)
local nthe = (args["nthe"] and yn_map[args["nthe"]]~=0) or (args["the"] and yn_map[args["the"]]~=0)
if the and pref
fthe = fthe and (pref and "t" or "T").."he " or ""
then the = "the "
nthe = nthe and (pref and "t" or "T").."he " or ""
elseif the
local flink = args["plink"] or args["flink"] or alink or space2emp((pref or "").." ")..thefthe..clink..space2emp(" "..(suff or ""))
then the = "The "
else the = ""
end
local flink = args["flink"] or alink or space2emp((pref or "").." ")..the..clink..space2emp(" "..(suff or ""))
 
local name = args["name"]
Line 68 ⟶ 65:
local cname = data["name alias-"..amap[avar].altvar] or data["shortname alias"] or data.alias or country
if mn == "f" then
name = name or space2emp((pref or "").." ")..thenthe..cname..space2emp(" "..(suff or ""))
else
name = name or cname
Line 74 ⟶ 71:
else
if mn == "f" then
name = name or space2emp((pref or "").." ")..thenthe..country..space2emp(" "..(suff or ""))
else
name = name or country
Line 130 ⟶ 127:
then
if pref and suff
then text = "[["..flink.."|"..pref.."]] "..thenthe.."[["..clink.."|"..name.."]] [["..flink.."|"..suff.."]]"
elseif pref
then text = "[["..flink.."|"..pref.."]] "..thenthe.."[["..clink.."|"..name.."]]"
elseif suff
then text = thenthe.."[["..clink.."|"..name.."]] [["..flink.."|"..suff.."]]"
else
text = thenthe.."[["..clink.."|"..name.."]]"
end
elseif mn=="d" --data template