Module:PartVariables/pt-br: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
mNo edit summary |
mNo edit summary |
||
Line 43: | Line 43: | ||
for abbreviation, full_name in pairs(abbreviations) do |
for abbreviation, full_name in pairs(abbreviations) do |
||
if string.find(input, abbreviation) == 1 then |
if string.find(input, abbreviation) == 1 then |
||
local page_with_suffix = mw.title.new(full_name .. "/pt-br") |
|||
if abbreviation == "CDDH" then |
|||
return "''[[Crazy Diamond's Demonic Heartbreak]]''" |
|||
elseif abbreviation == "JORGE JOESTAR" then |
|||
return "''[[JORGE JOESTAR (Novel)/pt-br|JORGE JOESTAR]]'' " .. string.sub(input, #abbreviation + 2) |
|||
⚫ | |||
elseif page_with_suffix.exists then |
|||
return "''[[" .. full_name .. "/pt-br|".. full_name .."]],'' " .. string.sub(input, #abbreviation + 2) |
|||
⚫ | |||
return "''[[" .. full_name .. "]],'' " .. string.sub(input, #abbreviation + 2) |
|||
end |
end |
||
end |
end |
Latest revision as of 02:44, 22 August 2024
Documentation for this module may be created at Module:PartVariables/pt-br/doc
local p = {}
local abbreviations = {
PB = "Phantom Blood",
BT = "Battle Tendency",
SC = "Stardust Crusaders",
SDC = "Stardust Crusaders",
DU = "Diamond is Unbreakable",
DIU = "Diamond is Unbreakable",
VA = "Vento Aureo",
GW = "Golden Wind",
SO = "Stone Ocean",
SBR = "Steel Ball Run",
JJL = "JoJolion",
TJL = "The JOJOLands",
TSKR = "Thus Spoke Kishibe Rohan",
CDDH = "Crazy Diamond's Demonic Heartbreak",
Baoh = "Baoh the Visitor",
["JORGE JOESTAR"] = "JORGE JOESTAR",
CSBT = "Cool Shock B.T.",
["Cool Shock Old B.T."] = "Cool Shock Old B.T.",
CSOBT = "Cool Shock Old B.T.",
["Gorgeous Irene"] = "Gorgeous Irene",
Eccentrics = "The Lives of Eccentrics",
["Purple Haze Feedback"] = "Purple Haze Feedback",
["The Book"] = "The Book jojo's bizarre adventure 4th another day",
["Crazy Heartbreakers"] = "Crazy Heartbreakers",
["rey infinito"] = "rey infinito",
["El Aleph"] = "El Aleph",
ASBR = "All-Star Battle R",
EoH = "Eyes of Heaven",
ASB = "All-Star Battle"
}
function p.getAbbreviations()
return abbreviations
end
function p.main(frame)
local input = frame.args[1]
-- Special Cases
for abbreviation, full_name in pairs(abbreviations) do
if string.find(input, abbreviation) == 1 then
local page_with_suffix = mw.title.new(full_name .. "/pt-br")
if abbreviation == "CDDH" then
return "''[[Crazy Diamond's Demonic Heartbreak]]''"
elseif abbreviation == "JORGE JOESTAR" then
return "''[[JORGE JOESTAR (Novel)/pt-br|JORGE JOESTAR]]'' " .. string.sub(input, #abbreviation + 2)
elseif page_with_suffix.exists then
return "''[[" .. full_name .. "/pt-br|".. full_name .."]],'' " .. string.sub(input, #abbreviation + 2)
else
return "''[[" .. full_name .. "]],'' " .. string.sub(input, #abbreviation + 2)
end
end
end
return input
end
return p