"Modül:GiftsByItem" sayfasının sürümleri arasındaki fark
Gezinti kısmına atla
Arama kısmına atla
Margotbean (mesaj | katkılar) |
Margotbean (mesaj | katkılar) |
||
25. satır: | 25. satır: | ||
for k,v in pairs(villagerlist) do | for k,v in pairs(villagerlist) do | ||
− | if v == (Dwarf) then | + | if tostring(v) == ("Dwarf") then |
villagerlist[k] = "Cüce" | villagerlist[k] = "Cüce" | ||
− | elseif v == (Wizard) then | + | elseif tostring(v) == ("Wizard") then |
villagerlist[k] = "Büyücü" | villagerlist[k] = "Büyücü" | ||
end | end |
00.17, 17 Ocak 2023 tarihindeki hâli
Description
This module takes a comma-separated list of villager names and transforms it into a bullet-separated list of villager icons + links to villager pages.
This module performs tasks that were formerly performed by arrays (sorting, translating, and formatting) in Template:GiftsByItem.
This module can be copy/pasted into all languages without alteration.
Please report any problems or issues with the module on the discussion page for Template:GiftsByItem.
local p = {}
function p.ts(frame)
local villagerlist = {frame.args[1]}
local lang = string.upper(mw.getContentLanguage().code)
if lang == "DE" then
if villagerlist.find("Dwarf") then
villagerlist.insert("Zwerg")
villagerlist.remove("Dwarf")
elseif villagerlist.find("Wizard") then
villagerlist.insert("Zauberer")
villagerlist.remove("Wizard")
end
elseif lang == "FR" then
--for loop that replaces 'Robin' with 'Robine'
--Dwarf with ???
--and Wizard with ???
elseif lang == "HU" then
elseif lang == "TR" then
for k,v in pairs(villagerlist) do
if tostring(v) == ("Dwarf") then
villagerlist[k] = "Cüce"
elseif tostring(v) == ("Wizard") then
villagerlist[k] = "Büyücü"
end
end
elseif lang == "ZH" then
end
table.sort(villagerlist)
--table.concat( villagerlist, " • " )
--villagerlist:gsub(villagerlist, "," , " • ")
return table.concat( villagerlist, " • " )
end
return p