Changes
Add translation variation support
local BaseData = require("Module:BaseData")
local BaseData = require("Module:BaseData")
local EquipmentData = BaseData({
local EquipmentData = BaseData({
_strict_translation_class = "strict-translation",
_common_translation_class = "common-translation",
_mobile_hide_class = "mobile-hide",
_display_none_css = {display = "none"},
_equipment_compatibility = {
_equipment_compatibility = {
[1] = {
[1] = {
function EquipmentData:name()
function EquipmentData:name()
return self._name
return self._name
end
function EquipmentData:common_name()
return self._common_name
end
function EquipmentData:base_name()
return self._base_name or self:name()
end
end
setmetatable(equip, equip)
setmetatable(equip, equip)
equip.__index = self
equip.__index = self
if equip._common_name then
equip._base_name = equip._name
equip._name = tostring(mw.html.create('span'):addClass(self._mobile_hide_class):addClass(self._strict_translation_class):css(self._display_none_css):wikitext(equip._name))
.. tostring(mw.html.create('span'):addClass(self._common_translation_class):wikitext(equip._common_name))
end
return equip
return equip
end
end