模組:VG NFC category handle
外观
require('Module:No globals')
local platformAlias = {
-- Nintendo
['红白机'] = {'[红紅]白[机機]', 'FC', 'Famicom', 'NES', 'Nintendo Entertainment System'},
['超级任天堂'] = {'超[級级]任天堂', '超任', 'SFC', 'Super Famicom', 'SNES'},
['任天堂64'] = {'任天堂64', 'N64'},
['GameCube'] = {'GameCube', '任天堂GameCube', 'NGC'},
['Wii'] = {'Wii'},
['Wii U'] = {'Wii U', 'WiiU'},
['任天堂Switch'] = {'任天堂Switch', 'Nintendo Switch', 'NS'},
-- Sony
['PlayStation (游戏机)'] = {'PlayStation \([游遊][戏戲][机機]\)', 'PlayStation', 'PS1'},
}
local getArgs = require('Module:Arguments').getArgs
local p = {}
function p.main(frame)
local args = getArgs(frame)
return p._main(args)
end
function p._main(args)
-- Main module code goes here.
for categoryName, aliases in pairs(platformAlias) do
for _, k in ipairs(aliases) do
if string.find(args[1], k) then
return categoryName
end
end
end
return args[1]
end
return p