Differenze tra le versioni di "Modulo:Wikilib/sigle"

Adding support for non-game abbreviations
(Adding support for black and black-on-gray colors and space-separated arguments in onMergedAbbrs)
(Adding support for non-game abbreviations)
-- Modulo contenente dati utili per le sigle dei giochi
--[[
 
local x = {}
Utility function for modules using Sigle/data
 
--]]
 
local q = {}
 
local txt = require('Modulo:Wikilib/strings') -- luacheck: no unused
local tab = require('Modulo:Wikilib/tables') -- luacheck: no unused
local w = require('Modulo:Wikilib')
local c = mw.loadData('Modulo:Colore/data')
local sig = mw.loadData('Modulo:Sigle/data')
local wData = mw.loadData('Modulo:Wikilib/data')
 
--[[
 
Ogni sigla ha associata una table per ogni link da
Ritorna il nome del/i gioco/i a partire dalla sigla,
visualizzare. Tale table ha la seguente struttura:
eventualmente con un separatore
 
- All'indice link il titolo della pagina
--]]
(senza Pokémon davanti per brevità)
q.gamesName = function(s, sep)
- All'indice text il testo da visualizzare nel link
return table.concat(table.map(sig[s][1].display, function(disp)
(opzionale, default all'indice link)
return string.fu(disp[2])
- All'indice display una table di coppie:
end), sep or '/')
- primo elemento: sigla del gioco
end
- secondo elemento: colore del gioco
 
--[[
 
This function returns the abbreviations of all the games in an abbreviaton
data, displayed in a background of the color of the game, or a very light gray
if the game has no color.
 
Arguments:
- data: the data of an abbreviation, from module Sigle/data.
- makeText: the function creating the text to be displayed. It takes the
abbreviation of a single game, and returns the text to be displayed
in the link. Defaults to tostring.
- makeColors: the function returning the colors to be used. It takes the
color name as an argument, and returns the background and text color
to be used in the link. Defaults to colorAndText.
 
Return:
- A list of strings, each one containing the text for the games grouped
together in the abbreviation data.
 
--]]
q.backgroundAbbrs = function(data, makeText, makeColors)
makeColors = makeColors or q.colorAndText
makeText = makeText or tostring
 
return q.mapDisplay(data, function(text, color)
local background, textColor = makeColors(color)
return string.interp('<span style="padding: 0 0.3em; background: #${bg}; color: #${color};">${text}</span>', {
bg = background,
color = textColor,
text = makeText(text)
})
end)
end
 
--[[
 
This function returns the links to all of the games in an abbreviation data,
displayed as abbreviations with a background of the color of the game, or
a very light gray if the game has no color.
 
Arguments:
- data: the data of an abbreviation, from module Sigle/data.
- makeText: the function creating the text to be displayed. It takes the
abbreviation of a single game, and returns the text to be displayed
in the link. Defaults to tostring.
- makeColors: the function returning the colors to be used. It takes the
color name as an argument, and returns the background and text color
to be used in the link. Defaults to colorAndText.
 
Return:
- A list of strings, each one containing a single link.
 
--]]
q.backgroundAbbrLinks = function(data, makeText, makeColors)
makeColors = makeColors or q.colorAndText
makeText = makeText or tostring
 
return q.makeLinks(data, function(abbrData)
return q.backgroundAbbrs(abbrData, makeText, makeColors)
end)
end
 
-- Returns the Wikicode to make a text bold
q.bolden = function(text)
return table.concat{"'''", text, "'''"}
end
 
--[[
 
This function returns the abbreviations of all the games in an abbreviaton
data, displayed in the specified color and shade. The color can be passed as
an hexadecimal or as a named color; it defaults to each game's own color, or
black if the game has no color. The shade default is 'normale'.
 
Arguments:
- data: the data of an abbreviation, from module Sigle/data.
- makeText: the function creating the text to be displayed. It takes the
abbreviation of a single game, and returns the text to be displayed
in the link. Defaults to tostring.
- textColor: The color the abbreviations should have. Can be a named color
or an hexadecimal Defaults to each game's own color.
- shade: The shade of the color to use. Defaults to 'normale'.
 
Return:
- A list of strings, each one containing the text for the games grouped
together in the abbreviation data.
 
--]]
q.coloredAbbrs = function(data, makeText, textColor, shade)
shade = shade or 'normale'
makeText = makeText or tostring
 
return q.mapDisplay(data, function(text, gameColor)
-- If the game has no color, using the text color from q.colorAndText
local color = textColor or gameColor or ({q.colorAndText()})[2]
return string.interp('<span style="color: #${color};">${text}</span>', {
-- This is ok also for when c[color][shade] evaluates to false
color = c[color] and c[color][shade] or color,
text = makeText(text)
})
end)
end
 
--[[
 
This function returns the links to all of the games in an abbreviation data,
displayed displayed in the specified color and shade. The color can be passed
as an hexadecimal or as a named color; it defaults to each game's own color, or
black if the game has no color. The shade default is 'normale'.
 
Arguments:
- data: the data of an abbreviation, from module Sigle/data.
- makeText: the function creating the text to be displayed. It takes the
abbreviation of a single game, and returns the text to be displayed
in the link. Defaults to tostring.
- textColor: The color the abbreviations should have. Can be a named color
or an hexadecimal Defaults to each game's own color.
- shade: the shade of games color to be used for the abbreviations.
Defaults to 'normale'.
 
Return:
- A list of strings, each one containing a single link.
 
--]]
q.coloredAbbrLinks = function(data, makeText, textColor, shade)
shade = shade or 'normale'
makeText = makeText or tostring
 
return q.makeLinks(data, function(abbrData)
return q.coloredAbbrs(abbrData, makeText, textColor, shade)
end)
end
 
--[[
 
This function takes as input a color as found in the elements if display key
in abbreviation data. It returns two hexadecimal colors: the first one is the
passed color one, the second one is the color the text should have if the first
color is used as a background.
 
The color can be passed in the following formats. A named color, in which case
the normale shade will be returned. An hexadecimal, that will be returned
unchanged: however, in this case the text color will always be black. Nil, that
implies returning a very light gray and black, as background and text color
respectively.
 
Arguments:
- color: input color, as found in display keys items.
 
--]]
q.colorAndText = function(color)
if not color then
return c.background, '000'
end
 
-- This is ok also for when c[color].normale evaluates to false
local background = c[color] and c[color].normale or color
local text = table.search(wData.whitetext, color:lower())
and c.background
or '000'
 
return background, text
end
 
--[[
 
This function concatenates the string representation of the passed
abbreviations, as found in the given data module. Every non-found abbreviaton
will have the empty string as its string representation.
 
Arguments:
- abbrs: The abbreviations to be merged, as a space separated string or as
a table
- dataModule: The data module holding the content that will be
concatenated.
 
--]]
q.concatAbbrs = function(abbrs, dataModule)
abbrs = type(abbrs) == 'string' and mw.text.split(abbrs, ' ') or abbrs
 
return w.mapAndConcat(abbrs, function(abbr)
return dataModule[abbr] or ''
end)
end
 
--[[
 
This function maps over all abbreviations in Sugle/data. Its main purpose is
increased efficiency, since the client modules can avoid requiring Sigle/data,
which is therefore mw.loaded here only once.
 
Arguments:
- f: the mapping function.
 
--]]
q.mapAbbrs = function(f)
return table.map(sig, f)
end
 
--[[
 
This function maps over the display key of every game in the passed
abbreviation data. The results of the mapping are concatenated for every
display property, so that the returned table is one-dimensioned.
 
Arguments:
- data: The source abbreviation data.
- makeText: The mapping function. It takes as parameters the two elements
of display key elements, that is the abbreviation and the color of a
game. Must return a string.
 
Return:
- A list of string, each one resulting from the concatenation of the items
in the display key of a game, after mapping.
 
--]]
q.mapDisplay = function(data, makeText)
return table.map(data, function(game)
return w.mapAndConcat(game.display, function(pair)
return makeText(pair[1], pair[2])
end)
end)
end
 
--[[
 
This function returns a list of links from the passed abbreviation data. The
links target is the page in the link key of every game in the data, while the
displayed text is obtained by mapping with the specified function.
 
Arguments:
- data: The source abbreviation data.
- makeText: The mapping function that produces the text to be displayed
for every game in the abbreviation data. Takes such data as an
argument, and must return a table with the text for every game in the
data, in the same order as they are in the abbreviation data.
 
Return:
- A list of links, one for each game in the abbreviation data.
 
--]]
q.makeLinks = function(data, makeText)
local zipped = table.zip(data, makeText(data))
 
return table.map(zipped, function(pair)
local game, text = unpack(pair)
 
return string.interp('[[${link}|${text}]]', {
link = 'Pokémon ' .. game.link,
text = text
})
end)
end
 
--[[
 
This function returns a table containing interface functions, both for lua and
wikicode. Wikicode interfaces are named after abbreviations, while lua
interfaces have the 'Lua' and '_lua' suffixes.
 
The interfaces are created by means of makeInterfaces, that must return at
least the lua function: the wikicode interface defaults to the standard one
calling the lua interface as in Wikilib.stdWikicodeInterface.
 
Arguments:
- makeInterfaces: This is the functino used to generate the lua interfaces,
and optionally the wikicode ones. Its parameters are abbreviation data
and its abbreviation. Must return the lua function and optionally the
wikicode one.
 
--]]
q.makeLuaAndWikicode = function(makeInterfaces)
local a = {}
 
for abbr, data in pairs(sig) do
local lua, wikicode = makeInterfaces(data, abbr)
wikicode = wikicode or w.stdWikicodeInterface(lua)
 
a[abbr .. 'Lua'], a[abbr .. '_lua'], a[abbr] = lua, lua, wikicode
end
 
return a
end
 
--[[
 
This function generates a WikiCode interface for client modules. As explained
below, the interface takes no arguments other than optional abbreviations.
 
This function is meant to be named after an abbreviation, and can take an
arbitrary number of additional abbreviations as arguments, even
space-seaparated within a single argument. For this intended use, an example
call would be:
 
{{#invoke: ClientModule | abbr0 | abbr1 | abbr2 abbr3 | abbr4 }}
 
The returned function processes every abbreviaton, including the one it is
meant to be named after, via makeGame, and then the resulting table is passed
on to postProcess for the final processing before returning the value to
WikiCode.
 
Arguments:
- abbr: the abbreviaton this function is meant to be bound to, that will
always be prepended to the passed arguments.
- makeAbbrev: this function is used to generate data for a single
abbreviation. It takes the data of such abbreviation in Sigle/data,
and returns whatever postProcess is able to handle as its list items.
- postProcess: this function is used for processing the data generated from
the abbreviations before the final result is given back to WikiCode.
It takes a list of whatever makeAbbrev returns, and should return a
string. Defaults to table.concat.
 
--]]
q.onMergedAbbrs = function(abbr, makeAbbrev, postProcess)
postProcess = postProcess or table.concat
 
return function(frame)
local args = w.trimAll(table.copy(frame.args))
args = table.flatMap(args, function(argument)
return mw.text.split(argument, ' ')
end)
table.insert(args, 1, abbr)
 
return postProcess(table.map(args, function(game)
return makeAbbrev(sig[game])
end))
end
end
 
--[[
 
This function generates a lua interface for client modules. As explained
below, the interface takes a single table, containing both arbitrary arguments
and extra abbreviations.
 
This function is meant to be named after an abbreviation, and takes as
argument a single table. One of the keys is meant to store some extra
abbreviations, either as a table or as a space-separated list. The other items
are the other arguments that the function needs.
 
Some example calls:
 
myModule.abbr0{games = {'abbr1', 'abbr2'}, arg1, arg2, arg3)
myModule.abbr0{games = 'abbr1 abbr2', arg1, arg2, arg3)
myModule.abbr0{arg1, arg2, arg3}
 
The returned function processes every abbreviaton, including the one it is
meant to be named after, via makeGame, and then the resulting table is passed
on to postProcess for the final processing before returning the value to
WikiCode.
 
Arguments:
- abbr: the abbreviaton this function is meant to be bound to, that will
always be prepended to the passed arguments.
- abbrKey: the key of the table the abbreviations are stored at.
Defaults to 'games'
- makeAbbrev: this function is used to generate data for a single
abbreviation. It takes the data of such abbreviation in Sigle/data and
the fixed final arguments packed in a table. It returns whatever
postProcess is able to handle as its list elements.
- postProcess: this function is used for processing the data generated from
the abbreviations before the final result is given back to WikiCode.
It takes the fixed final arguments packed in a table and a list of
whatever makeAbbrev returns, and should return a string. Defaults to
a function concatenating the second argument.
 
--]]
q.onMergedAbbrsArgs = function(abbr, abbrKey, makeAbbrev, postProcess)
postProcess = postProcess or function(_, t) return table.concat(t) end
abbrKey = abbrKey or 'games'
 
local luaInterface = function(args)
local abbrs = args[abbrKey] or {}
 
if type(abbrs) == 'string' then
abbrs = abbrs == '' and {} or mw.text.split(abbrs, ' ')
end
table.insert(abbrs, 1, abbr)
 
args[abbrKey] = nil
 
x.R = {{
return postProcess(args, table.map(abbrs, function(game)
link = 'Pokémon Rosso e Blu',
return makeAbbrev(sig[game], args)
text = end))'Rosso',
enddisplay = {
{'R', 'rosso'}
}
}}
x.B = {{
link = 'Pokémon Rosso e Blu',
text = 'Blu',
display = {
{'B', 'blu'}
}
}}
x.V = {{
link = 'Pokémon Rosso e Verde',
text = 'Verde',
display = {
{'V', 'verde'}
}
}}
x.G = {{
link = 'Pokémon Giallo',
display = {
{'G', 'giallo'}
}
}}
x.RB = {{
link = 'Pokémon Rosso e Blu',
display = {
{'R', 'rosso'},
{'B', 'blu'}
}
}}
x.RV = {{
link = 'Pokémon Rosso e Verde',
display = {
{'R', 'rosso'},
{'V', 'verde'}
}
}}
x.RBG = {
{
link = 'Pokémon Rosso e Blu',
text = 'Rosso, Blu',
display = {
{'R', 'rosso'},
{'B', 'blu'}
}
}, x.G[1]}
x.RVBG = {x.RBG[1],
{
link = 'Pokémon Blu (Giappone)',
text = 'Blu',
display = {
{'B', 'blu'}
}
}, x.G[1]
}
x.O = {{
link = 'Pokémon Oro e Argento',
text = 'Oro',
display = {
{'O', 'oro'}
}
}}
x.A = {{
link = 'Pokémon Oro e Argento',
text = 'Argento',
display = {
{'A', 'argento'}
}
}}
x.C = {{
link = 'Pokémon Cristallo',
display = {
{'C', 'cristallo'}
}
}}
x.OA = {{
link = 'Pokémon Oro e Argento',
display = {
{'O', 'oro'},
{'A', 'argento'}
}
}}
x.OAC = {
{
link = 'Pokémon Oro e Argento',
text = 'Oro, Argento',
display = {
{'O', 'oro'},
{'A', 'argento'}
}
}, x.C[1]}
x.Ru = {{
link = 'Pokémon Rubino e Zaffiro',
text = 'Rubino',
display = {
{'R', 'rubino'}
}
}}
x.RU = x.Ru
x.Z = {{
link = 'Pokémon Rubino e Zaffiro',
text = 'Zaffiro',
display = {
{'Z', 'zaffiro'}
}
}}
x.S = {{
link = 'Pokémon Smeraldo',
display = {
{'S', 'smeraldo'}
}
}}
x.Sm, x.SM = x.S, x.S
x.RZ = {{
link = 'Pokémon Rubino e Zaffiro',
display = {
{'R', 'rubino'},
{'Z', 'zaffiro'}
}
}}
x.RuZa, x.RUZA = x.RZ, x.RZ
x.RZS = {
{
link = 'Pokémon Rubino e Zaffiro',
text = 'Rubino, Zaffiro',
display = {
{'R', 'rubino'},
{'Z', 'zaffiro'}
}
}, x.S[1]}
x.RuZaSm, x.RUZASM = x.RZS, x.RZS
x.RS = {x.Ru[1], x.S[1]}
x.RuS, x.RUS = x.RS, x.RS
x.ZS = {x.Z[1], x.S[1]}
x.RF = {{
link = 'Pokémon Rosso Fuoco e Verde Foglia',
text = 'Rosso Fuoco',
display = {
{'RF', 'rossofuoco'}
}
}}
x.VF = {{
link = 'Pokémon Rosso Fuoco e Verde Foglia',
text = 'Verde Foglia',
display = {
{'VF', 'verdefoglia'}
}
}}
x.RFVF = {{
link = 'Pokémon Rosso Fuoco e Verde Foglia',
display = {
{'RF', 'rossofuoco'},
{'VF', 'verdefoglia'}
}
}}
x.RZSRFVF = {x.RZS[1], x.S[1], x.RFVF[1]}
x.RuZaSmRFVF, x.RUZASMRFVF = x.RZSRFVF, x.RZSRFVF
x.RBGRFVF = {x.RBG[1], x.G[1], x.RFVF[1]}
x.SRFVF = {x.S[1], x.RFVF[1]}
-- x.SMRFVF, x.RFVFS = x.SRFVF, x.SRFVF
x.D = {{
link = 'Pokémon Diamante e Perla',
text = 'Diamante',
display = {
{'D', 'diamante'}
}
}}
x.P = {{
link = 'Pokémon Diamante e Perla',
text = 'Perla',
display = {
{'P', 'perla'}
}
}}
x.Pt = {{
link = 'Pokémon Platino',
display = {
{'Pt', 'platino'}
}
}}
x.PT = x.Pt
x.DP = {{
link = 'Pokémon Diamante e Perla',
display = {
{'D', 'diamante'},
{'P', 'perla'}
}
}}
x.DPPt = {
{
link = 'Pokémon Diamante e Perla',
text = 'Diamante, Perla',
display = {
{'D', 'diamante'},
{'P', 'perla'}
}
}, x.Pt[1]}
x.DPP, x.DPPT = x.DPPt, x.DPPt
x.DPt = {x.D[1], x.Pt[1]}
x.DPT = x.DPt
x.PPt = {x.P[1], x.Pt[1]}
x.PPT = x.PPt
x.HG = {{
link = 'Pokémon Oro HeartGold e Argento SoulSilver',
text = 'Oro HeartGold',
display = {
{'HG', 'heartgold'}
}
}}
x.SS = {{
link = 'Pokémon Oro HeartGold e Argento SoulSilver',
text = 'Argento SoulSilver',
display = {
{'SS', 'soulsilver'}
}
}}
x.HGSS = {{
link = 'Pokémon Oro HeartGold e Argento SoulSilver',
display = {
{'HG', 'heartgold'},
{'SS', 'soulsilver'}
}
}}
x.DHGSS = {x.D[1], x.HGSS[1]}
x.PHGSS = {x.P[1], x.HGSS[1]}
x.DPPtHGSS = {x.DPPt[1], x.Pt[1], x.HGSS[1]}
x.DPPHGSS, x.DPPTHGSS = x.DPPtHGSS, x.DPPtHGSS
x.PtHGSS = {x.Pt[1], x.HGSS[1]}
x.PTHGSS = x.PtHGSS
x.OHG = {x.O[1], x.HG[1]}
x.ASS = {x.A[1], x.SS[1]}
x.OCHG = {x.O[1], x.C[1], x.HG[1]}
x.OACSS = {x.OAC[1], x.C[1], x.SS[1]}
x.CHGSS = {x.C[1], x.HGSS[1]}
x.OACHGSS = {x.OAC[1], x.C[1], x.HGSS[1]}
x.RFVFHGSS = {
{
link = 'Pokémon Rosso Fuoco e Verde Foglia',
text = 'Rosso Fuoco, Verde Foglia',
display = {
{'RF', 'rossofuoco'},
{'VF', 'verdefoglia'}
}
}, x.HGSS[1]}
x.OACRFVFHGSS = {x.OAC[1], x.C[1], x.RFVFHGSS[1], x.HGSS[1]}
x.N = {{
link = 'Pokémon Nero e Bianco',
text = 'Nero',
display = {
{'N', 'nero'}
}
}}
x.Bi = {{
link = 'Pokémon Nero e Bianco',
text = 'Bianco',
display = {
{'B', 'bianco'}
}
}}
x.BI = x.Bi
x.NB = {{
link = 'Pokémon Nero e Bianco',
display = {
{'N', 'nero'},
{'B', 'bianco'}
}
}}
x.NeBi, x.NEBI = x.NB, x.NB
x.N2 = {{
link = 'Pokémon Nero 2 e Bianco 2',
text = 'Nero 2',
display = {
{'N2', 'nero2'}
}
}}
x.B2 = {{
link = 'Pokémon Nero 2 e Bianco 2',
text = 'Bianco 2',
display = {
{'B2', 'bianco2'}
}
}}
x.N2B2 = {{
link = 'Pokémon Nero 2 e Bianco 2',
display = {
{'N2', 'nero2'},
{'B2', 'bianco2'}
}
}}
x.NN2 = {x.N[1], x.N2[1]}
x.BB2 = {x.Bi[1], x.B2[1]}
x.NBN2B2 = {
{
link = 'Pokémon Nero e Bianco',
text = 'Nero, Bianco',
display = {
{'N', 'nero'},
{'B', 'bianco'}
}
}, x.N2B2[1]}
x.X = {{
link = 'Pokémon X e Y',
text = 'X',
display = {
{'X', 'x'}
}
}}
x.Y = {{
link = 'Pokémon X e Y',
text = 'Y',
display = {
{'Y', 'y'}
}
}}
x.XY = {{
link = 'Pokémon X e Y',
display = {
{'X', 'x'},
{'Y', 'y'}
}
}}
x.RO = {{
link = 'Pokémon Rubino Omega e Zaffiro Alpha',
text = 'Rubino Omega',
display = {
{'RΩ', 'rubinoomega'}
}
}}
x.ZA = {{
link = 'Pokémon Rubino Omega e Zaffiro Alpha',
text = 'Zaffiro Alpha',
display = {
{'Zα', 'zaffiroalpha'}
}
}}
x.ROZA = {{
link = 'Pokémon Rubino Omega e Zaffiro Alpha',
display = {
{'RΩ', 'rubinoomega'},
{'Zα', 'zaffiroalpha'}
}
}}
x.XYROZA = {
{
link = 'Pokémon X e Y',
text = 'X, Y',
display = {
{'X', 'x'},
{'Y', 'y'}
}
}, x.ROZA[1]}
x.RRO = {x.Ru[1], x.RO[1]}
x.ZZA = {x.Z[1], x.ZA[1]}
x.RZROZA = {x.RZS[1], x.ROZA[1]}
x.SROZA = {x.S[1], x.ROZA[1]}
x.RSRO = {x.Ru[1], x.S[1], x.RO[1]}
x.ZSZA = {x.Z[1], x.S[1], x.ZA[1]}
x.RZSROZA = {x.RZS[1], x.S[1], x.ROZA[1]}
x.DemoROZA = {{
link = 'Pokémon Rubino Omega e Zaffiro Alpha Versione Demo Speciale',
display = {
{'Demo'},
{'RΩ', 'rubinoomega'},
{'Zα', 'zaffiroalpha'},
}
}}
x.So = {{
link = 'Pokémon Sole e Luna',
text = 'Sole',
display = {
{'S', 'sole'}
}
}}
x.SO = x.So
x.L = {{
link = 'Pokémon Sole e Luna',
text = 'Luna',
display = {
{'L', 'luna'}
}
}}
x.SL = {{
link = 'Pokémon Sole e Luna',
display = {
{'S', 'sole'},
{'L', 'luna'}
}
}}
x.DemoSL = {{
link = 'Pokémon Sole e Pokémon Luna: Versione demo speciale',
text = 'Sole e Luna: Versione demo speciale',
display = {
{'Demo'},
{'S', 'sole'},
{'L', 'luna'},
}
}}
x.Us = {{
link = 'Pokémon Ultrasole e Ultraluna',
text = 'Ultrasole',
display = {
{'Us', 'ultrasole'}
}
}}
x.US = x.Us
x.Ul = {{
link = 'Pokémon Ultrasole e Ultraluna',
text = 'Ultraluna',
display = {
{'Ul', 'ultraluna'}
}
}}
x.UL = x.Ul
x.UsUl = {{
link = 'Pokémon Ultrasole e Ultraluna',
display = {
{'Us', 'ultrasole'},
{'Ul', 'ultraluna'}
}
}}
x.USUL, x.USL = x.UsUl, x.UsUl
x.SUs = {x.So[1], x.Us[1]}
x.SUS, x.SoUs = x.SUs, x.SUs
x.LUl = {x.L[1], x.Ul[1]}
x.LUL = x.LUl
x.SLUsUl = {
{
link = 'Pokémon Sole e Luna',
text = 'Sole, Luna',
display = {
{'S', 'sole'},
{'L', 'luna'}
}
}, x.USUL[1]}
x.SLUSUL = x.SLUsUl
x.LGP = {{
link = "Pokémon: Let's Go, Pikachu! e Let's Go, Eevee!",
text = "Let's Go, Pikachu!",
display = {
{'LGP', 'LG_pikachu'}
}
}}
x.LgP = x.LGP
x.LGE = {{
link = "Pokémon: Let's Go, Pikachu! e Let's Go, Eevee!",
text = "Let's Go, Eevee!",
display = {
{'LGE', 'LG_eevee'}
}
}}
x.LgE = x.LGE
x.LGPE = {{
link = "Pokémon: Let's Go, Pikachu! e Let's Go, Eevee!",
display = {
{'LG'},
{'P', 'LG_pikachu'},
{'E', 'LG_eevee'}
}
}}
x.LgPE = x.LGPE
x.SJ = {{
link = 'Pokémon Stadium (Giappone)',
text = 'Stadium',
display = {
{'SJ', 'rosso'}
}
}}
x.St = {{
link = 'Pokémon Stadium',
display = {
{'St', 'rosso'}
}
}}
x.ST = x.St
x.S2 = {{
link = 'Pokémon Stadium 2',
display = {
{'S2', 'oro'}
}
}}
x.St2, x.ST2 = x.S2, x.S2
x.StS2 = {x.St[1], x.S2[1]}
x.COLO = {{
link = 'Pokémon Colosseum',
display = {
{'Colo.', 'colo'}
}
}}
x.Colo = x.COLO
x.XD = {{
link = 'Pokémon XD: Tempesta Oscura',
text = 'XD',
display = {
{'XD', 'XD'}
}
}}
x.ColoXD = {x.Colo[1], x.XD[1]}
x.COLOXD = x.ColoXD
x.PBR = {{
link = 'Pokémon Battle Revolution',
display = {
{'BR', 'battle_revolution'}
}
}}
x.PMDR = {{
link = 'Pokémon Mystery Dungeon: Squadra Rossa e Squadra Blu',
text = 'Mystery Dungeon: Squadra Rossa',
display = {
{'R', 'mdrosso'}
}
}}
x.PMDB = {{
link = 'Pokémon Mystery Dungeon: Squadra Rossa e Squadra Blu',
text = 'Mystery Dungeon: Squadra Blu',
display = {
{'B', 'mdblu'}
}
}}
x.PMDRB = {{
link = 'Pokémon Mystery Dungeon: Squadra Rossa e Squadra Blu',
display = {
{'R', 'mdrosso'},
{'B', 'mdblu'}
}
}}
x.PMDT = {{
link = "Pokémon Mystery Dungeon: Esploratori del Tempo ed Esploratori dell'Oscurità",
text = 'Mystery Dungeon: Esploratori del Tempo',
display = {
{'T', 'mdtempo'}
}
}}
x.Time, x.Tempo, x.TIME, x.TEMPO = x.PMDT, x.PMDT, x.PMDT, x.PMDT
x.PMDO = {{
link = "Pokémon Mystery Dungeon: Esploratori del Tempo ed Esploratori dell'Oscurità",
text = "Mystery Dungeon: Esploratori dell'Oscurità",
display = {
{'O', 'mdoscurita'}
}
}}
x.PMDD, x['Oscurità'], x.Oscurita, x.Darkenss = x.PMDO, x.PMDO, x.PMDO, x.PMDO
x['OSCURITÀ'], x.OSCURITA, x.DARKNESS = x.PMDO, x.PMDO, x.PMDO
x.PMDTO = {{
link = "Pokémon Mystery Dungeon: Esploratori del Tempo ed Esploratori dell'Oscurità",
display = {
{'T', 'mdtempo'},
{'O', 'mdoscurita'}
}
}}
x.PMDTD = x.PMDTO
x.PMDC = {{
link = 'Pokémon Mystery Dungeon: Esploratori del Cielo',
display = {
{'C', 'mdcielo'}
}
}}
x.PMDS, x.Sky, x.Cielo, x.SKY, x.CIELO = x.PMDC, x.PMDC, x.PMDC, x.PMDC, x.PMDC
x.PMDTOC = {x.PMDTO[1], x.PMDC[1]}
x.PMDTDS = x.PMDTOC
x.PMDTC = {x.PMDT[1], x.PMDC[1]}
x.PMDTS = x.PMDTC
x.PMDOC = {x.PMDO[1], x.PMDC[1]}
x.PMDDS = x.PMDOC
x.PMDPSI = {{
link = "Pokémon Mystery Dungeon: I Portali sull'Infinito",
display = {
{'PSI', 'mdportali'}
}
}}
x.PMDPsI, x.PMDGTI, x.Infnito = x.PMDPSI, x.PMDPSI, x.PMDPSI
x.infnito, x.INFINITO, x.Infinity = x.PMDPSI, x.PMDPSI, x.PMDPSI
x.infinity, x.INFINITY = x.PMDPSI, x.PMDPSI
x.PSMD = {{
link = "Pokémon Super Mystery Dungeon",
display = {
{'SMD', 'mdsuper'}
}
}}
x.Super, x.super = x.PSMD, x.PSMD
 
-- Non-games abbreviations
return luaInterface
x.CPM = {{
end
link = 'Club Pokémiglia',
display = {
{'CPM', 'club_pokémiglia'}
}
}}
x.DW = {{
link = 'Pokémon Dream World',
display = {
{'DW', 'dream_world'}
}
}}
x.PW = {{
link = 'Pokéwalker',
display = {
{'PW', 'pokewalker'}
}
}}
x.SA = {{
link = 'Safari Amici',
display = {
{'SA', 'safari_amici'}
}
}}
 
return qx