From 357e84ead5f4c9404c500fe080cdc93d78c751a9 Mon Sep 17 00:00:00 2001 From: thibautbus <310327033+thibautbus@users.noreply.github.com> Date: Sat, 19 Sep 2026 19:45:30 +0200 Subject: [PATCH] Translate FireRed ability names where they are shown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Species, move, item and trainer names reach a translation mod through registries, but nothing renames abilities: battle messages ("'s prevents ...") and the summary page printed the ROM's English name whatever the language. Abilities.name and the summary's ability line now pass the name through Strings(), keyed by the cart's English name ("SPEED BOOST", "COMPOUNDEYES"). The identifiers the battle code compares (SPEED_BOOST) and the description lookup are unchanged. --- src/core/game3/battle/abilities.lua | 4 +++- src/ui/game3/summary_menu.lua | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/game3/battle/abilities.lua b/src/core/game3/battle/abilities.lua index 2cfa4357..5d7e7d4c 100644 --- a/src/core/game3/battle/abilities.lua +++ b/src/core/game3/battle/abilities.lua @@ -8,9 +8,11 @@ local Abilities = {} -- pokefirered/src/data/text/abilities.h:162 local DISPLAY = { COMPOUND_EYES = "COMPOUNDEYES", LIGHTNING_ROD = "LIGHTNINGROD" } +-- The name battle messages print. No registry renames abilities, so a +-- translation reaches them through Strings(), keyed by the cart's English. function Abilities.name(ab) if not ab then return "" end - return DISPLAY[ab] or (ab:gsub("_", " ")) + return Strings(DISPLAY[ab] or (ab:gsub("_", " "))) end -- pokefirered/src/battle_util.c:31 diff --git a/src/ui/game3/summary_menu.lua b/src/ui/game3/summary_menu.lua index b59b1777..db42c758 100644 --- a/src/ui/game3/summary_menu.lua +++ b/src/ui/game3/summary_menu.lua @@ -583,7 +583,8 @@ local function draw_page_skills(mon) end ability = ability or "—" local ax, ay = cxy("abilityName", 74, 129) - draw_text(tostring(ability), ax, ay, 80, "NORMAL") + -- No registry renames abilities; a translation reaches the name through Strings(). + draw_text(Strings(tostring(ability)), ax, ay, 80, "NORMAL") local desc = SummaryData.abilityDescription(abilityId, tostring(ability)) local ad = coords().abilityDesc or { x = 10, y = 143, w = 232 } draw_text(desc, ad.x or 10, ad.y or 143, ad.w or 232, "NORMAL")