Editing Module:LangGive feedback
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 7: | Line 7: | ||
-- the expected key does not have a localization entry | -- the expected key does not have a localization entry | ||
local KEY_OVERRIDES = { | local KEY_OVERRIDES = { | ||
MoveSlowPercent_label = 'MovementSlow_label', | MoveSlowPercent_label = 'MovementSlow_label', | ||
BonusHealthRegen_label = 'HealthRegen_label', | BonusHealthRegen_label = 'HealthRegen_label', | ||
| Line 23: | Line 21: | ||
PostInvisBuffDuration_label = 'BuffDuration_label', | PostInvisBuffDuration_label = 'BuffDuration_label', | ||
PostInvisBuffDuration_postfix = 'BuffDuration_postfix', | PostInvisBuffDuration_postfix = 'BuffDuration_postfix', | ||
SelfBuffDuration_label = 'BuffDuration_label', | SelfBuffDuration_label = 'BuffDuration_label', | ||
SelfBuffDuration_postfix = 'BuffDuration_postfix', | SelfBuffDuration_postfix = 'BuffDuration_postfix', | ||
| Line 35: | Line 31: | ||
DashRange_label = 'TargetDashRadius_label', | DashRange_label = 'TargetDashRadius_label', | ||
DashRange_postfix = 'TargetDashRadius_postfix', | DashRange_postfix = 'TargetDashRadius_postfix', | ||
} | } | ||
| Line 64: | Line 56: | ||
BonusMoveSpeed = {icon='{{Icon/Green|[[File:Move_speed.png|link=Move speed|20px]]}}', label_color='#ffefd7', link='Move speed'}, | BonusMoveSpeed = {icon='{{Icon/Green|[[File:Move_speed.png|link=Move speed|20px]]}}', label_color='#ffefd7', link='Move speed'}, | ||
BonusSprintSpeed = {icon='{{Icon/Green|[[File:Move_speed.png|link=Sprint speed|20px]]}}', label_color='#ffefd7', link='Sprint speed'}, | BonusSprintSpeed = {icon='{{Icon/Green|[[File:Move_speed.png|link=Sprint speed|20px]]}}', label_color='#ffefd7', link='Sprint speed'}, | ||
BonusSpiritDamage = {icon='{{Icon/NoColor|[[File: | BonusSpiritDamage = {icon='{{Icon/NoColor|[[File:AttributeIconTechShieldHealth.png|link=Spirit Damage|12px]]}}', label_color='#bc8ee8', link='Spirit Damage'}, | ||
BonusWeaponDamage = {icon='{{Icon/NoColor|[[File:Bullet Damage.png|link=Weapon Damage|20px]]}}', label_color='#ec981a', link='Weapon Damage'}, | BonusWeaponDamage = {icon='{{Icon/NoColor|[[File:Bullet Damage.png|link=Weapon Damage|20px]]}}', label_color='#ec981a', link='Weapon Damage'}, | ||
bullet_armor_up = {icon='{{Icon/White|[[File:Barrier.png|link=Barrier|20px]]}}', label_color='#ffefd7', link='Barrier'}, | bullet_armor_up = {icon='{{Icon/White|[[File:Barrier.png|link=Barrier|20px]]}}', label_color='#ffefd7', link='Barrier'}, | ||
bullet_damage = {icon='{{Icon/ | bullet_damage = {icon='{{Icon/Brown|[[File:Damage.png|link=Weapon Damage|20px]]}}', label_color='#ec981a', link='Weapon Damage'}, | ||
BulletResist = {icon='{{Icon/Brown|[[File:Bullet_Armor.png|link=Damage_Resistance|20px]]}}', label_color='#ec981a', link='Damage_Resistance'}, | BulletResist = {icon='{{Icon/Brown|[[File:Bullet_Armor.png|link=Damage_Resistance|20px]]}}', label_color='#ec981a', link='Damage_Resistance'}, | ||
cast = {icon='{{Icon/White|[[File:Cast.png|link=|20px]]}}', label_color='#ffefd7', link=''}, | cast = {icon='{{Icon/White|[[File:Cast.png|link=|20px]]}}', label_color='#ffefd7', link=''}, | ||
| Line 73: | Line 65: | ||
cooldown = {icon='{{Icon/White|[[File:AttributeIconTechDuration.png|link=Ability Cooldown|20px]]}}', label_color='#ffefd7', link='Ability Cooldown'}, | cooldown = {icon='{{Icon/White|[[File:AttributeIconTechDuration.png|link=Ability Cooldown|20px]]}}', label_color='#ffefd7', link='Ability Cooldown'}, | ||
damage = {icon='{{Icon/NoColor|[[File:Damage heart.png|link=Damage|20px]]}}', label_color='#ec981a', link='Damage'}, | damage = {icon='{{Icon/NoColor|[[File:Damage heart.png|link=Damage|20px]]}}', label_color='#ec981a', link='Damage'}, | ||
FireRate = {icon='{{Icon/White|[[File:Fire_Rate.png|link=Fire Rate|20px]]}}', label_color='#ffefd7', link='Fire Rate'}, | FireRate = {icon='{{Icon/White|[[File:Fire_Rate.png|link=Fire Rate|20px]]}}', label_color='#ffefd7', link='Fire Rate'}, | ||
fire_rate = {icon='{{Icon/White|[[File:Fire_Rate.png|link=Fire Rate|20px]]}}', label_color='#ffefd7', link='Fire Rate'}, | fire_rate = {icon='{{Icon/White|[[File:Fire_Rate.png|link=Fire Rate|20px]]}}', label_color='#ffefd7', link='Fire Rate'}, | ||
| Line 99: | Line 90: | ||
SlowResistance = {icon='{{Icon/White|[[File:MoveSlow.png|link=Movement_Slow#Movement_Slow_Resist|20px]]}}', label_color='#ffefd7', link='Movement_Slow#Movement_Slow_Resist'}, | SlowResistance = {icon='{{Icon/White|[[File:MoveSlow.png|link=Movement_Slow#Movement_Slow_Resist|20px]]}}', label_color='#ffefd7', link='Movement_Slow#Movement_Slow_Resist'}, | ||
Spirit = {icon='{{Icon/NoColor|[[File:Spirit_icon.png|link=Spirit Power|20px]]}}', label_color='#bc8ee8', link='Spirit Power'}, | Spirit = {icon='{{Icon/NoColor|[[File:Spirit_icon.png|link=Spirit Power|20px]]}}', label_color='#bc8ee8', link='Spirit Power'}, | ||
SpiritDamage = {icon='{{Icon/NoColor|[[File: | SpiritDamage = {icon='{{Icon/NoColor|[[File:AttributeIconTechShieldHealth.png|link=Spirit Damage|12px]]}}', label_color='#bc8ee8', link='Spirit Damage'}, | ||
SpiritDPS = {icon='{{Icon/NoColor|[[File: | SpiritDPS = {icon='{{Icon/NoColor|[[File:AttributeIconTechShieldHealth.png|link=Spirit Damage|12px]]}}', label_color='#bc8ee8', link='Spirit Damage'}, | ||
SpiritIcon = {icon='{{Icon/NoColor|[[File: | SpiritIcon = {icon='{{Icon/NoColor|[[File:AttributeIconTechShieldHealth.png|link=Spirit Damage|12px]]}}', link='Spirit Damage'}, | ||
SpiritResist = {icon='{{Icon/Purple|[[File:Spirit_Armor.png|link=Damage_Resistance|20px]]}}', label_color='#bc8ee8', link='Damage_Resistance'}, | SpiritResist = {icon='{{Icon/Purple|[[File:Spirit_Armor.png|link=Damage_Resistance|20px]]}}', label_color='#bc8ee8', link='Damage_Resistance'}, | ||
StatDesc_TechPower = {icon='{{Icon/NoColor|[[File: | StatDesc_TechPower = {icon='{{Icon/NoColor|[[File:AttributeIconTechShieldHealth.png|link=Spirit Damage|12px]]}}', label_color='#bc8ee8', link='Spirit Damage'}, | ||
Stun = {icon='{{Icon/White|[[File:Status_Stun.png|link=Stun|20px]]}}', link='Stun'}, | Stun = {icon='{{Icon/White|[[File:Status_Stun.png|link=Stun|20px]]}}', link='Stun'}, | ||
stun = {icon='{{Icon/White|[[File:Stun.png|link=|20px]]}}', label_color='#ffefd7', link=''}, | stun = {icon='{{Icon/White|[[File:Stun.png|link=|20px]]}}', label_color='#ffefd7', link=''}, | ||
tech_armor_up = {icon='{{Icon/White|[[File:Barrier.png|link=Barrier|20px]]}}', label_color='#ffefd7', link='Barrier'}, | tech_armor_up = {icon='{{Icon/White|[[File:Barrier.png|link=Barrier|20px]]}}', label_color='#ffefd7', link='Barrier'}, | ||
tech_damage = {icon='{{Icon/NoColor|[[File: | tech_damage = {icon='{{Icon/NoColor|[[File:AttributeIconTechShieldHealth.png|link=Spirit Damage|12px]]}}', link='Spirit Damage'}, | ||
WeaponDamage = {icon='{{Icon/NoColor|[[File:Bullet Damage.png|link=Weapon Damage|20px]]}}', label_color='#ec981a', link='Weapon Damage'}, | WeaponDamage = {icon='{{Icon/NoColor|[[File:Bullet Damage.png|link=Weapon Damage|20px]]}}', label_color='#ec981a', link='Weapon Damage'}, | ||
} | } | ||
| Line 116: | Line 105: | ||
text = text:gsub('<span class="highlight">(.-)</span>', "<span style= font-weight:bold>%1</span>") | text = text:gsub('<span class="highlight">(.-)</span>', "<span style= font-weight:bold>%1</span>") | ||
text = text:gsub('<span class="highlight_spirit">(.-)</span>', '<span style="font-weight:bold; color:#bc8ee8">%1</span>') | text = text:gsub('<span class="highlight_spirit">(.-)</span>', '<span style="font-weight:bold; color:#bc8ee8">%1</span>') | ||
text = text:gsub('<span class="diminish">(.-)</span>', '<span style="font-style: italic;color:#C0C0C0">%1</span>') | text = text:gsub('<span class="diminish">(.-)</span>', '<span style="font-style: italic;color:#C0C0C0">%1</span>') | ||
-- Process InlineAttributeIcon panels - handle unclosed panel tags | |||
text = text:gsub('<panel class="InlineAttributeIcon ([^"]+)"[^>]*>([^<]+)', function(key, spanText) | |||
local replacement = replacements[key] | |||
if replacement then | |||
local label_color = replacement.label_color or 'inherit' | |||
local icon = replacement.icon or '' | |||
local link = replacement.link or '' | |||
-- Extract just the first word/phrase before any other text | |||
spanText = spanText:match("^%s*([^%s]+)") | |||
if not spanText or spanText == '' then | |||
return string.format('<span class="no-blue-link" style="text-wrap:nowrap; font-weight:bold; color:%s;">%s</span>', label_color, icon) | |||
else | |||
return string.format('<span class="no-blue-link" style="text-wrap:nowrap; font-weight:bold; color:%s;">%s [[%s|%s]]</span>', | |||
label_color, | |||
icon, | |||
link, | |||
spanText) | |||
end | |||
else | |||
return '<span style="color:red;font-weight:bold;border-bottom:1px dotted red;" title="Missing attribute definition - Add \''..key..'\' to local replacements in [Module:Lang]">['..key..']</span>' | |||
end | |||
end) | |||
text = text:gsub('<span class=".-">(.-)</span>', '%1') | text = text:gsub('<span class=".-">(.-)</span>', '%1') | ||
text = text:gsub('<Panel class=\"AbilityPropertyIcon StatDesc_TechPower\">', '{{Icon/Purple|[[File: | text = text:gsub('<Panel class=\"AbilityPropertyIcon StatDesc_TechPower\">', '{{Icon/Purple|[[File:AttributeIconTechShieldHealth.png|link=Spirit Damage|12px]]}}') | ||
text = text:gsub('</Panel>', '') | text = text:gsub('</Panel>', '') | ||
text = text:gsub('</panel>', '') | |||
-- Process panel tags | -- Process panel tags | ||
| Line 169: | Line 184: | ||
end | end | ||
end) | end) | ||
KEYBINDS = { | |||
-- Movement | |||
MoveForward = "'''Move Forward button'''", | |||
AltCast = " | MoveBackwards = "'''Move Backward button'''", | ||
} | MoveLeft = "'''Move Left button'''", | ||
MoveRight = "'''Move Right button'''", | |||
Mantle = "'''Jump button'''", | |||
Zipline = "'''Zipline button'''", | |||
Roll = "'''Dash button'''", | |||
Crouch = "'''Crouch button'''", | |||
MoveDown = "'''Fly Down button'''", | |||
MoveUp = "'''Fly Up button'''", | |||
-- Combat | |||
Attack = "'''Fire button'''", | |||
ADS = "'''Alt-Fire button'''", | |||
Reload = "'''Reload button'''", | |||
AbilityMelee = "'''Melee button'''", | |||
HeldItem = "'''Melee Parry/Throw Held Item button'''", | |||
-- Abilities | |||
Ability1 = "'''Ability 1 button'''", | |||
Ability2 = "'''Ability 2 button'''", | |||
Ability3 = "'''Ability 3 button'''", | |||
Ability4 = "'''Ability 4 button'''", | |||
AltCast = "'''Alternate Cast'''", | |||
-- UI & Menus | |||
OpenHeroSheet = "'''Open Shop button'''", | |||
PurchaseQuickbuy = "'''Purchase Quickbuy button'''", | |||
Scoreboard = "'''Scoreboard button'''", | |||
OpenMainMenu = "'''Open Main Menu button'''", | |||
-- Communication | |||
PushToTalk = "'''Voice Chat button'''", | |||
-- Misc & Hideout | |||
Pause = "'''Pause button'''", | |||
ReplayDeath = "'''Replay Death button'''", | |||
HideoutUse = "'''Interact with an object in the Hideout button'''", | |||
HideoutCancelMatchmaking = "'''Cancel Matchmaking button'''", | |||
} | |||
-- Process citadel_binding/citadel_keybind tags to replace with keybind strings/templates | -- Process citadel_binding/citadel_keybind tags to replace with keybind strings/templates | ||
text = text:gsub("{g:citadel_binding:'(.-)'}", function(key) | text = text:gsub("{g:citadel_binding:'(.-)'}", function(key) | ||
local replacement = KEYBINDS[key] | |||
if replacement then | |||
return replacement | |||
else | |||
return '<span style="color:red;font-weight:bold;border-bottom:1px dotted red;" title="Missing keybind - Add \''..key..'\' to local replacements in [Module:Lang]">['..key..']</span>' | |||
end | |||
return | end) | ||
text = text:gsub("{g:citadel_keybind:'(.-)'}", function(key) | |||
local replacement = KEYBINDS[key] | |||
if replacement then | |||
return replacement | |||
else | |||
return '<span style="color:red;font-weight:bold;border-bottom:1px dotted red;" title="Missing keybind - Add \''..key..'\' to local replacements in [Module:Lang]">['..key..']</span>' | |||
end | |||
end) | end) | ||
| Line 204: | Line 261: | ||
local frame | local frame | ||
if type(key) == "table" and key.args then | if type(key) == "table" and key.args then | ||
frame = | frame = key | ||
key = frame.args[1] | |||
lang_code_override = frame.args["lang_code_override"] | |||
fallback_str = frame.args["fallback_str"] | |||
lang_code_override = args["lang_code_override"] | remove_var_index = frame.args["remove_var_index"] | ||
fallback_str = args["fallback_str"] | item_name = frame.args["item_name"] | ||
remove_var_index = args["remove_var_index"] | |||
item_name = args["item_name"] | |||
else | else | ||
frame = mw.getCurrentFrame() | frame = mw.getCurrentFrame() | ||