From 24d0c6528da1c22608d69743e3ef8086d27d1adc Mon Sep 17 00:00:00 2001 From: thibautbus <310327033+thibautbus@users.noreply.github.com> Date: Sun, 16 Aug 2026 20:36:41 +0200 Subject: [PATCH] Translate the stat name in RBY's X-item and vitamin rose! messages Both the player-side and AI-trainer stat-rise messages (X ATTACK/ DEFENSE/etc. and the vitamins) passed the raised stat's name as a raw uppercase Lua string (stat:upper()), bypassing Strings() entirely, so it always rendered in English regardless of the active language even though the surrounding sentence template was already translated. Wrap the substituted stat name in Strings() at every call site (src/inventory/ItemEffects.lua's two player-side messages and src/battle/TrainerAI.lua's AI-trainer X-item message, found in review), reusing the same "ATTACK"/"DEFENSE"/"SPEED"/"SPECIAL"/"HP" keys SummaryMenu.lua's stat labels already look up the same way. --- src/battle/TrainerAI.lua | 2 +- src/inventory/ItemEffects.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/battle/TrainerAI.lua b/src/battle/TrainerAI.lua index 9654029a..7eb4bb32 100644 --- a/src/battle/TrainerAI.lua +++ b/src/battle/TrainerAI.lua @@ -124,7 +124,7 @@ function TrainerAI.useItem(battle, item) elseif X_STAT[item] then local stat = X_STAT[item] enemy.stages[stat] = math.min(6, (enemy.stages[stat] or 0) + 1) - table.insert(msgs, Strings("%s's\n%s rose!", displayName(enemy), stat:upper())) + table.insert(msgs, Strings("%s's\n%s rose!", displayName(enemy), Strings(stat:upper()))) elseif item == "GUARD_SPEC" then enemy.mist = true table.insert(msgs, Strings("%s's\nprotected against\nstat changes!", displayName(enemy))) diff --git a/src/inventory/ItemEffects.lua b/src/inventory/ItemEffects.lua index a900fec9..678cc517 100644 --- a/src/inventory/ItemEffects.lua +++ b/src/inventory/ItemEffects.lua @@ -294,7 +294,7 @@ function ItemEffects.use(data, save, itemId, target, battle, moveIndex, ow) "Nothing happened!") } end b.stages[stat] = cur + 1 - return "consumed", { Strings("%s's\n%s rose!", b.name, stat:upper()) } + return "consumed", { Strings("%s's\n%s rose!", b.name, Strings(stat:upper())) } end -- ItemUseDireHit/ItemUseGuardSpec always set the bit and consume -- the item, even when it is already active @@ -493,7 +493,7 @@ function ItemEffects.use(data, save, itemId, target, battle, moveIndex, ow) -- Spanish ROM puts the stat before the name), so the extracted line -- cannot be filled positionally; the engine wording stands return "consumed", { Strings("%s's %s\nrose!", monName(data, target), - vitaminStat == "hp" and "HP" or vitaminStat:upper()) } + Strings(vitaminStat == "hp" and "HP" or vitaminStat:upper())) } end -- PP UP boosts the move the player picked (ItemUsePPUp's move menu)