From 1a23b985fcfa02a5bd1ed4a74e91ff15bb6384e9 Mon Sep 17 00:00:00 2001 From: Ezequiel Zacca Date: Sun, 25 Oct 2026 15:57:49 -0300 Subject: [PATCH 1/4] fix(items): damage texts read as sentences, without a stray "of" or "i" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wings', capes' and pets' "Increase/Absorb ...% of Damage" kept the English "of" in Spanish, Indonesian, Portuguese, Russian, Tagalog, Ukrainian and Chinese ("Aumenta el daño de 12% of", "增加 12% of 傷害"), in the two shared texts, in the Guardian Angel's, Imp's and Horn of Dinorant's own lines, and in the game's texts other code still prints ("Increase %d%% of Damage", "Absorb %d%% of Damage"). They read as sentences of their language now, the same everywhere. The "i" of "%% increase" leaked into seven translations of the Siege Potion's "Damage +20% increase effect" ("iefecto", "infeito", "inувеличение", ...). --- src/Localization/Game.es.resx | 4 +- src/Localization/Game.id.resx | 4 +- src/Localization/Game.pt.resx | 4 +- src/Localization/Game.ru.resx | 4 +- src/Localization/Game.tl.resx | 4 +- src/Localization/Game.uk.resx | 4 +- src/Localization/Game.zh-TW.resx | 4 +- src/bin/Data/Items/Group13_Helper.json | 54 ++++++++++++------------ src/bin/Data/Items/Group14_Potion.json | 14 +++--- src/bin/Data/Items/Tooltips/Tooltip.json | 28 ++++++------ 10 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/Localization/Game.es.resx b/src/Localization/Game.es.resx index 851f903a0f..aea8fadb1b 100644 --- a/src/Localization/Game.es.resx +++ b/src/Localization/Game.es.resx @@ -2129,11 +2129,11 @@ legacy_id=575 - Aumenta el daño de %d%% of + Aumenta el daño un %d%% legacy_id=577 - Absorber daño %d%% of + Absorbe el %d%% del daño legacy_id=578 diff --git a/src/Localization/Game.id.resx b/src/Localization/Game.id.resx index c1ca3aa1ae..5e07b678c0 100644 --- a/src/Localization/Game.id.resx +++ b/src/Localization/Game.id.resx @@ -2129,11 +2129,11 @@ legacy_id=575 - Meningkatkan Kerusakan %d%% of + Meningkatkan Kerusakan %d%% legacy_id=577 - Menyerap Kerusakan %d%% of + Menyerap %d%% Kerusakan legacy_id=578 diff --git a/src/Localization/Game.pt.resx b/src/Localization/Game.pt.resx index f3208fcff3..5a5789188e 100644 --- a/src/Localization/Game.pt.resx +++ b/src/Localization/Game.pt.resx @@ -2129,11 +2129,11 @@ legacy_id=575 - Aumentar o dano de %d%% of + Aumenta o dano em %d%% legacy_id=577 - Absorver Dano %d%% of + Absorve %d%% do dano legacy_id=578 diff --git a/src/Localization/Game.ru.resx b/src/Localization/Game.ru.resx index 8ce1359596..fd3930c5f6 100644 --- a/src/Localization/Game.ru.resx +++ b/src/Localization/Game.ru.resx @@ -2129,11 +2129,11 @@ legacy_id=575 - Увеличение урона %d%% of + Увеличение урона на %d%% legacy_id=577 - Поглощение %d%% of урона + Поглощение %d%% урона legacy_id=578 diff --git a/src/Localization/Game.tl.resx b/src/Localization/Game.tl.resx index 94c822c08c..d4aa004184 100644 --- a/src/Localization/Game.tl.resx +++ b/src/Localization/Game.tl.resx @@ -2129,11 +2129,11 @@ legacy_id=575 - Dagdagan ang %d%% of Pinsala + Dagdagan ang Pinsala nang %d%% legacy_id=577 - Isipsip ang %d%% of Pinsala + Isipsip ang %d%% ng Pinsala legacy_id=578 diff --git a/src/Localization/Game.uk.resx b/src/Localization/Game.uk.resx index 0a68309bc4..f067482f7d 100644 --- a/src/Localization/Game.uk.resx +++ b/src/Localization/Game.uk.resx @@ -2129,11 +2129,11 @@ legacy_id=575 - Збільшення шкоди на %d%% of + Збільшення шкоди на %d%% legacy_id=577 - Поглинання шкоди %d%% of + Поглинання %d%% шкоди legacy_id=578 diff --git a/src/Localization/Game.zh-TW.resx b/src/Localization/Game.zh-TW.resx index 411ee7f9da..ae9778717b 100644 --- a/src/Localization/Game.zh-TW.resx +++ b/src/Localization/Game.zh-TW.resx @@ -2129,11 +2129,11 @@ legacy_id=575 - 增加 %d%% of 傷害 + 增加 %d%% 傷害 legacy_id=577 - 吸收%d%% of傷害 + 吸收%d%%傷害 legacy_id=578 diff --git a/src/bin/Data/Items/Group13_Helper.json b/src/bin/Data/Items/Group13_Helper.json index 1935b832cd..84145dcd49 100644 --- a/src/bin/Data/Items/Group13_Helper.json +++ b/src/bin/Data/Items/Group13_Helper.json @@ -16,15 +16,15 @@ "text": { "en": "Absorb 20% of Damage", "de": "Absorbiert 20% des Schadens", - "es": "Absorber daño 20% of", - "id": "Menyerap Kerusakan 20% of", + "es": "Absorbe el 20% del daño", + "id": "Menyerap 20% Kerusakan", "ja": "ダメージ 20%吸収", "pl": "Pochłania 20% obrażeń", - "pt": "Absorver Dano 20% of", - "ru": "Поглощение 20% of урона", - "tl": "Isipsip ang 20% of Pinsala", - "uk": "Поглинання шкоди 20% of", - "zh-TW": "吸收20% of傷害" + "pt": "Absorve 20% do dano", + "ru": "Поглощение 20% урона", + "tl": "Isipsip ang 20% ng Pinsala", + "uk": "Поглинання 20% шкоди", + "zh-TW": "吸收20%傷害" } }, { @@ -81,15 +81,15 @@ "text": { "en": "Increase 30% of attacking & Wizardry Dmg", "de": "Erhöht Angriffs- und Zaubereischaden um 30%", - "es": "Aumenta 30% of ataque y daño de hechicería", - "id": "Meningkatkan 30% of serangan & Dmg Sihir", + "es": "Aumenta un 30% el ataque y el daño de hechicería", + "id": "Meningkatkan serangan & Dmg Sihir 30%", "ja": "攻撃力、力 30%増加", "pl": "Zwiększa obrażenia fizyczne i magiczne o 30%", "pt": "Aumenta em 30% o dano de ataque e magia", - "ru": "Увеличение на 30% of урона от атак и волшебства.", - "tl": "Dagdagan ang 30% of pag-atake at Wizardry Dmg", - "uk": "Збільште на 30% of шкоду від атаки та магії", - "zh-TW": "攻擊力和魔法傷害增加30% of" + "ru": "Увеличение урона от атак и волшебства на 30%.", + "tl": "Dagdagan ang pag-atake at Wizardry Dmg nang 30%", + "uk": "Збільшує шкоду від атаки та магії на 30%", + "zh-TW": "攻擊力和魔法傷害增加30%" } }, { @@ -166,30 +166,30 @@ "text": { "en": "Increase 15% of Damage", "de": "Erhöht den Schaden um 15%", - "es": "Aumenta el daño de 15% of", - "id": "Meningkatkan Kerusakan 15% of", + "es": "Aumenta el daño un 15%", + "id": "Meningkatkan Kerusakan 15%", "ja": "ダメージ 15%増加", "pl": "Zwiększa obrażenia o 15%", - "pt": "Aumentar o dano de 15% of", - "ru": "Увеличение урона 15% of", - "tl": "Dagdagan ang 15% of Pinsala", - "uk": "Збільшення шкоди на 15% of", - "zh-TW": "增加 15% of 傷害" + "pt": "Aumenta o dano em 15%", + "ru": "Увеличение урона на 15%", + "tl": "Dagdagan ang Pinsala nang 15%", + "uk": "Збільшення шкоди на 15%", + "zh-TW": "增加 15% 傷害" } }, { "text": { "en": "Absorb 10% of Damage", "de": "Absorbiert 10% des Schadens", - "es": "Absorber daño 10% of", - "id": "Menyerap Kerusakan 10% of", + "es": "Absorbe el 10% del daño", + "id": "Menyerap 10% Kerusakan", "ja": "ダメージ 10%吸収", "pl": "Pochłania 10% obrażeń", - "pt": "Absorver Dano 10% of", - "ru": "Поглощение 10% of урона", - "tl": "Isipsip ang 10% of Pinsala", - "uk": "Поглинання шкоди 10% of", - "zh-TW": "吸收10% of傷害" + "pt": "Absorve 10% do dano", + "ru": "Поглощение 10% урона", + "tl": "Isipsip ang 10% ng Pinsala", + "uk": "Поглинання 10% шкоди", + "zh-TW": "吸收10%傷害" } }, { diff --git a/src/bin/Data/Items/Group14_Potion.json b/src/bin/Data/Items/Group14_Potion.json index 001a6e5abd..ed88afcfae 100644 --- a/src/bin/Data/Items/Group14_Potion.json +++ b/src/bin/Data/Items/Group14_Potion.json @@ -169,15 +169,15 @@ "text": { "en": "Damage +20% increase effect", "de": "Effekt: Schaden +20%", - "es": "Daño +20% iefecto de aumento", - "id": "Kerusakan +20% imeningkatkan efek", + "es": "Daño +20% efecto de aumento", + "id": "Kerusakan +20% meningkatkan efek", "ja": "攻撃力+20%上昇效果", "pl": "Efekt zwiększenia obrażeń o 20%", - "pt": "Dano +20% infeito de aumento", - "ru": "Урон +20% inувеличение эффекта", - "tl": "Pinsala +20% ipagtaas na epekto", - "uk": "Пошкодження +20% inпосилення ефекту", - "zh-TW": "傷害+20% i效果增加" + "pt": "Dano +20% efeito de aumento", + "ru": "Урон +20% увеличение эффекта", + "tl": "Pinsala +20% pagtaas na epekto", + "uk": "Пошкодження +20% посилення ефекту", + "zh-TW": "傷害+20% 效果增加" }, "color": "darkRed", "levels": [0, 0] diff --git a/src/bin/Data/Items/Tooltips/Tooltip.json b/src/bin/Data/Items/Tooltips/Tooltip.json index b76a50670f..a1add13998 100644 --- a/src/bin/Data/Items/Tooltips/Tooltip.json +++ b/src/bin/Data/Items/Tooltips/Tooltip.json @@ -381,28 +381,28 @@ "damageIncrease": { "en": "Increase {percent}% of Damage", "de": "Erhöht den Schaden um {percent}%", - "es": "Aumenta el daño de {percent}% of", - "id": "Meningkatkan Kerusakan {percent}% of", + "es": "Aumenta el daño un {percent}%", + "id": "Meningkatkan Kerusakan {percent}%", "ja": "ダメージ {percent}%増加", "pl": "Zwiększa obrażenia o {percent}%", - "pt": "Aumentar o dano de {percent}% of", - "ru": "Увеличение урона {percent}% of", - "tl": "Dagdagan ang {percent}% of Pinsala", - "uk": "Збільшення шкоди на {percent}% of", - "zh-TW": "增加 {percent}% of 傷害" + "pt": "Aumenta o dano em {percent}%", + "ru": "Увеличение урона на {percent}%", + "tl": "Dagdagan ang Pinsala nang {percent}%", + "uk": "Збільшення шкоди на {percent}%", + "zh-TW": "增加 {percent}% 傷害" }, "damageAbsorb": { "en": "Absorb {percent}% of Damage", "de": "Absorbiert {percent}% des Schadens", - "es": "Absorber daño {percent}% of", - "id": "Menyerap Kerusakan {percent}% of", + "es": "Absorbe el {percent}% del daño", + "id": "Menyerap {percent}% Kerusakan", "ja": "ダメージ {percent}%吸収", "pl": "Pochłania {percent}% obrażeń", - "pt": "Absorver Dano {percent}% of", - "ru": "Поглощение {percent}% of урона", - "tl": "Isipsip ang {percent}% of Pinsala", - "uk": "Поглинання шкоди {percent}% of", - "zh-TW": "吸收{percent}% of傷害" + "pt": "Absorve {percent}% do dano", + "ru": "Поглощение {percent}% урона", + "tl": "Isipsip ang {percent}% ng Pinsala", + "uk": "Поглинання {percent}% шкоди", + "zh-TW": "吸收{percent}%傷害" }, "increaseSpeed": { "en": "Increase speed", From 46e440c878fc366eb7be340147fc058d774fe429 Mon Sep 17 00:00:00 2001 From: Ezequiel Zacca Date: Sun, 25 Oct 2026 16:05:05 -0300 Subject: [PATCH 2/4] fix(items): the Fruits' stat words name the stats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Fruits' stat words came from a machine translation that read ENG as "English" (Spanish "ESP", Portuguese "POR", Indonesian "Bahasa Inggris", Russian "АНГЛ", Chinese "英語"), AGI as "artificial general intelligence" (Russian "ОИИ", Chinese "通用人工智慧") and Command as an order (Polish "Rozkaz", Tagalog "Utos", Indonesian "Memerintah", Russian and Ukrainian "Команда", Chinese "命令"); they name the stats now. English is unchanged. The level lines' test no longer compares the Fruits' stat lines with the game's texts, which keep the words this corrects. --- src/bin/Data/Items/Group13_Helper.json | 44 ++++++++++++------------- tests/data/test_item_database_files.cpp | 26 +++++---------- 2 files changed, 30 insertions(+), 40 deletions(-) diff --git a/src/bin/Data/Items/Group13_Helper.json b/src/bin/Data/Items/Group13_Helper.json index 84145dcd49..df7acd2462 100644 --- a/src/bin/Data/Items/Group13_Helper.json +++ b/src/bin/Data/Items/Group13_Helper.json @@ -702,28 +702,28 @@ { "en": "ENG", "de": "ENG", - "es": "ESP", - "id": "Bahasa Inggris", + "es": "ENE", + "id": "ENG", "ja": "エナジー", "pl": "ENG", - "pt": "POR", - "ru": "АНГЛ", + "pt": "ENE", + "ru": "ЭНЕ", "tl": "ENG", - "uk": "ENG", - "zh-TW": "英語" + "uk": "ЕНЕ", + "zh-TW": "能量" }, { "en": "STA", "de": "VIT", - "es": "STA", + "es": "VIT", "id": "STA", "ja": "体力", "pl": "STA", - "pt": "STA", - "ru": "СТА", + "pt": "VIT", + "ru": "ВЫН", "tl": "STA", - "uk": "STA", - "zh-TW": "史塔" + "uk": "ВИТ", + "zh-TW": "體力" }, { "en": "AGI", @@ -733,10 +733,10 @@ "ja": "敏捷性", "pl": "AGI", "pt": "AGI", - "ru": "ОИИ", + "ru": "ЛВК", "tl": "AGI", - "uk": "AGI", - "zh-TW": "通用人工智慧" + "uk": "СПР", + "zh-TW": "敏捷" }, { "en": "STR", @@ -746,23 +746,23 @@ "ja": "力", "pl": "STR", "pt": "FOR", - "ru": "СТР", + "ru": "СИЛ", "tl": "STR", - "uk": "ВУЛ", - "zh-TW": "STR" + "uk": "СИЛ", + "zh-TW": "力量" }, { "en": "Command", "de": "Führung", "es": "Dominio", - "id": "Memerintah", + "id": "Kepemimpinan", "ja": "統率", "pl": "Dowodzenie", "pt": "Comando", - "ru": "Команда", - "tl": "Utos", - "uk": "Команда", - "zh-TW": "命令" + "ru": "Командование", + "tl": "Pamumuno", + "uk": "Командування", + "zh-TW": "統率" } ] }, diff --git a/tests/data/test_item_database_files.cpp b/tests/data/test_item_database_files.cpp index a85c27fa38..756182a92e 100644 --- a/tests/data/test_item_database_files.cpp +++ b/tests/data/test_item_database_files.cpp @@ -862,12 +862,11 @@ TEST_CASE("The second item chain's tooltip texts keep their translations [data][ } // What the old code printed for an item's level lines in the UI's language, where the texts are the game's that other -// code still prints: one entry per line of OldLevelLines, empty for a text only the tooltip had (removed since). A -// Fruit's stat lines started with the stat's name; the rest of them was a removed text. +// code still prints: one entry per line of OldLevelLines, empty for a text only the tooltip had (removed since). The +// Fruits' stat lines aren't compared: their stat words are corrected here, and stay wrong in the game's texts. struct PrintedOldLine { std::string text; - bool isPrefix = false; }; std::string PrintWithName(const wchar_t* format, const wchar_t* name) @@ -893,10 +892,8 @@ std::vector> PrintedOldLevelLines(int group, int n } if (group == 13 && number == 15 && level <= 4) { - const wchar_t* const stats[] = {I18N::Game::ENG, I18N::Game::STA, I18N::Game::AGI, I18N::Game::STR, - I18N::Game::Command}; - const PrintedOldLine stat{Core::Text::ToUtf8(stats[level]) + " ", true}; - std::vector> lines = {stat, stat, printed(I18N::Game::ItCanBeUsedWithItemRemoved)}; + std::vector> lines = {std::nullopt, std::nullopt, + printed(I18N::Game::ItCanBeUsedWithItemRemoved)}; if (level == 4) { lines.push_back(PrintedOldLine{PrintWithName(I18N::Game::CanBeEquippedByS, I18N::Game::DarkLord)}); @@ -944,23 +941,16 @@ TEST_CASE("The tooltip texts by item level are the game's texts in every languag continue; } const std::string text = FilledLine(*found, *shown[index], level, profiles, locale); - if (old[index]->isPrefix) - { - CHECK(text.starts_with(old[index]->text)); - } - else - { - CHECK(text == old[index]->text); - } + CHECK(text == old[index]->text); ++compared; } } I18N::SetLocale("en"); } } - // Archer and Spearman, Scroll of Guardian and Place Life Stone, and the Fruits' 3 lines at +0 to +3 and 4 at +4, in - // every language. - CHECK(compared == (2 + 2 + 4 * 3 + 4) * static_cast(std::size(I18N::GetAvailableLocales()))); + // Archer and Spearman, Scroll of Guardian and Place Life Stone, and the Fruits' last line at +0 to +3 and last two + // at +4, in every language. + CHECK(compared == (2 + 2 + 4 * 1 + 2) * static_cast(std::size(I18N::GetAvailableLocales()))); } // The texts the tooltip code wrote for these items are their descriptions now, in every UI language. From d231e49d220f6ff12f63e0a428f0c99a522d17fc Mon Sep 17 00:00:00 2001 From: Ezequiel Zacca Date: Sun, 25 Oct 2026 16:05:05 -0300 Subject: [PATCH 3/4] test(items): the damage texts and the Fruits' stat words in each language Renders the two damage texts with 12 in each language they had wrong, checks that no translation of them keeps "% of", and checks the Command Fruit's stat words at +0 to +4 in each corrected language. --- tests/data/test_item_database_files.cpp | 74 +++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/tests/data/test_item_database_files.cpp b/tests/data/test_item_database_files.cpp index 756182a92e..53fc826f94 100644 --- a/tests/data/test_item_database_files.cpp +++ b/tests/data/test_item_database_files.cpp @@ -953,6 +953,80 @@ TEST_CASE("The tooltip texts by item level are the game's texts in every languag CHECK(compared == (2 + 2 + 4 * 1 + 2) * static_cast(std::size(I18N::GetAvailableLocales()))); } +// The damage texts without the English "of" and the Fruits' stat words, as #828 fixed them: rendered with 12 in each +// language they had wrong, and no translation of the two texts keeps "% of". +TEST_CASE("The damage texts and the Fruits' stat words read right in every language [data][items]") +{ + ClientDataScope client(ShippedClientDirectory); + std::string errorMessage; + REQUIRE(g_ItemDataHandler.Load(errorMessage)); + const Data::Items::ItemTooltipFile& tooltips = g_ItemDatabase.GetTooltipFile(); + const Data::LocalizedString* increase = tooltips.FindText("damageIncrease"); + const Data::LocalizedString* absorb = tooltips.FindText("damageAbsorb"); + REQUIRE(increase != nullptr); + REQUIRE(absorb != nullptr); + const auto twelve = [](std::string_view text) + { return Data::Items::FillPlaceholders(text, [](std::string_view) { return std::optional("12"); }); }; + + struct Damage + { + const char* locale; + const char* increase; + const char* absorb; + }; + const Damage damages[] = { + {"es", "Aumenta el da\u00f1o un 12%", "Absorbe el 12% del da\u00f1o"}, + {"pt", "Aumenta o dano em 12%", "Absorve 12% do dano"}, + {"ru", "\u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0443\u0440\u043e\u043d\u0430 \u043d\u0430 12%", "\u041f\u043e\u0433\u043b\u043e\u0449\u0435\u043d\u0438\u0435 12% \u0443\u0440\u043e\u043d\u0430"}, + {"uk", "\u0417\u0431\u0456\u043b\u044c\u0448\u0435\u043d\u043d\u044f \u0448\u043a\u043e\u0434\u0438 \u043d\u0430 12%", "\u041f\u043e\u0433\u043b\u0438\u043d\u0430\u043d\u043d\u044f 12% \u0448\u043a\u043e\u0434\u0438"}, + {"id", "Meningkatkan Kerusakan 12%", "Menyerap 12% Kerusakan"}, + {"tl", "Dagdagan ang Pinsala nang 12%", "Isipsip ang 12% ng Pinsala"}, + {"zh-TW", "\u589e\u52a0 12% \u50b7\u5bb3", "\u5438\u653612%\u50b7\u5bb3"}, + }; + for (const Damage& damage : damages) + { + INFO(damage.locale); + CHECK(twelve(increase->Get(damage.locale)) == damage.increase); + CHECK(twelve(absorb->Get(damage.locale)) == damage.absorb); + } + for (const Data::LocalizedString* text : {increase, absorb}) + { + for (const auto& [locale, translation] : text->GetTranslations()) + { + INFO(locale); + CHECK(translation.find("% of") == std::string::npos); + } + } + + // The Command Fruit's {stat} at +0 to +4: ENG, STA, AGI, STR and Command. + const Data::Items::ItemDefinition* fruit = g_ItemDatabase.Find(13 * MAX_ITEM_INDEX + 15); + REQUIRE(fruit != nullptr); + REQUIRE(fruit->levelValues.size() == 1); + const std::vector& words = fruit->levelValues.front().values; + REQUIRE(words.size() == 5); + struct Stats + { + const char* locale; + std::array words; + }; + const Stats stats[] = { + {"es", {"ENE", "VIT", "AGI", "FUE", "Dominio"}}, + {"pt", {"ENE", "VIT", "AGI", "FOR", "Comando"}}, + {"ru", {"\u042d\u041d\u0415", "\u0412\u042b\u041d", "\u041b\u0412\u041a", "\u0421\u0418\u041b", "\u041a\u043e\u043c\u0430\u043d\u0434\u043e\u0432\u0430\u043d\u0438\u0435"}}, + {"uk", {"\u0415\u041d\u0415", "\u0412\u0418\u0422", "\u0421\u041f\u0420", "\u0421\u0418\u041b", "\u041a\u043e\u043c\u0430\u043d\u0434\u0443\u0432\u0430\u043d\u043d\u044f"}}, + {"zh-TW", {"\u80fd\u91cf", "\u9ad4\u529b", "\u654f\u6377", "\u529b\u91cf", "\u7d71\u7387"}}, + {"id", {"ENG", "STA", "AGI", "STR", "Kepemimpinan"}}, + }; + for (const Stats& stat : stats) + { + for (size_t level = 0; level < words.size(); ++level) + { + INFO(stat.locale << " +" << level); + CHECK(words[level].text.Get(stat.locale) == stat.words[level]); + } + } +} + // The texts the tooltip code wrote for these items are their descriptions now, in every UI language. TEST_CASE("The original items' tooltip texts are in their descriptions [data][items]") { From 0eb19aea1153108423ffd9d6dd5f4ce819c46923 Mon Sep 17 00:00:00 2001 From: Ezequiel Zacca Date: Sun, 25 Oct 2026 16:43:10 -0300 Subject: [PATCH 4/4] =?UTF-8?q?fix(items):=20the=20game's=20stat=20words?= =?UTF-8?q?=20as=20the=20Fruits=20say=20them;=20Japanese=20=E5=8A=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Fruits' names, ground labels and inventory messages, the character window and the item requirement columns take their stat words from the game's ENG, STA, AGI, STR and Command texts, which kept the mistranslations the Fruits' description no longer has ("АНГЛ Fruits" above "ЭНЕ Увеличивает..."). In es, id, pt, ru, tl, uk and zh-TW they're the Fruits' words now, so one tooltip names a stat one way. The level lines' test compares the Fruits' stat words with the game's texts again. Chinese "Energy" was 活力, the same word as "Vitality"; it's 能量. The Siege Potion's Japanese line and three Japanese game texts used the Chinese 效 for 効. --- src/Localization/Game.es.resx | 4 ++-- src/Localization/Game.id.resx | 4 ++-- src/Localization/Game.ja.resx | 6 +++--- src/Localization/Game.pt.resx | 4 ++-- src/Localization/Game.ru.resx | 10 +++++----- src/Localization/Game.tl.resx | 2 +- src/Localization/Game.uk.resx | 10 +++++----- src/Localization/Game.zh-TW.resx | 12 ++++++------ src/bin/Data/Items/Group14_Potion.json | 2 +- tests/data/test_item_database_files.cpp | 26 +++++++++++++++++-------- 10 files changed, 45 insertions(+), 35 deletions(-) diff --git a/src/Localization/Game.es.resx b/src/Localization/Game.es.resx index aea8fadb1b..9dd191d917 100644 --- a/src/Localization/Game.es.resx +++ b/src/Localization/Game.es.resx @@ -664,11 +664,11 @@ legacy_id=167 - ESP + ENE legacy_id=168 - STA + VIT legacy_id=169 diff --git a/src/Localization/Game.id.resx b/src/Localization/Game.id.resx index 5e07b678c0..60fa441030 100644 --- a/src/Localization/Game.id.resx +++ b/src/Localization/Game.id.resx @@ -664,7 +664,7 @@ legacy_id=167 - Bahasa Inggris + ENG legacy_id=168 @@ -6357,7 +6357,7 @@ legacy_id=1737 - Memerintah + Kepemimpinan legacy_id=1738,1900 diff --git a/src/Localization/Game.ja.resx b/src/Localization/Game.ja.resx index d96b87b299..184ac42af8 100644 --- a/src/Localization/Game.ja.resx +++ b/src/Localization/Game.ja.resx @@ -5200,7 +5200,7 @@ legacy_id=1462 - 攻撃力+25上昇效果 + 攻撃力+25上昇効果 legacy_id=1463 @@ -6424,7 +6424,7 @@ legacy_id=1786 - 強化段階別效果上昇 + 強化段階別効果上昇 legacy_id=1787 @@ -6596,7 +6596,7 @@ legacy_id=1839 - +效果制限 + +効果制限 legacy_id=1840 diff --git a/src/Localization/Game.pt.resx b/src/Localization/Game.pt.resx index 5a5789188e..d3e2938463 100644 --- a/src/Localization/Game.pt.resx +++ b/src/Localization/Game.pt.resx @@ -664,11 +664,11 @@ legacy_id=167 - POR + ENE legacy_id=168 - STA + VIT legacy_id=169 diff --git a/src/Localization/Game.ru.resx b/src/Localization/Game.ru.resx index fd3930c5f6..98051ead54 100644 --- a/src/Localization/Game.ru.resx +++ b/src/Localization/Game.ru.resx @@ -656,19 +656,19 @@ legacy_id=165 - СТР + СИЛ legacy_id=166 - ОИИ + ЛВК legacy_id=167 - АНГЛ + ЭНЕ legacy_id=168 - СТА + ВЫН legacy_id=169 @@ -6357,7 +6357,7 @@ legacy_id=1737 - Команда + Командование legacy_id=1738,1900 diff --git a/src/Localization/Game.tl.resx b/src/Localization/Game.tl.resx index d4aa004184..21c1fbfb8a 100644 --- a/src/Localization/Game.tl.resx +++ b/src/Localization/Game.tl.resx @@ -6357,7 +6357,7 @@ legacy_id=1737 - Utos + Pamumuno legacy_id=1738,1900 diff --git a/src/Localization/Game.uk.resx b/src/Localization/Game.uk.resx index f067482f7d..36c4b90d1a 100644 --- a/src/Localization/Game.uk.resx +++ b/src/Localization/Game.uk.resx @@ -656,19 +656,19 @@ legacy_id=165 - ВУЛ + СИЛ legacy_id=166 - AGI + СПР legacy_id=167 - ENG + ЕНЕ legacy_id=168 - STA + ВИТ legacy_id=169 @@ -6357,7 +6357,7 @@ legacy_id=1737 - Команда + Командування legacy_id=1738,1900 diff --git a/src/Localization/Game.zh-TW.resx b/src/Localization/Game.zh-TW.resx index ae9778717b..33f9f0ad5c 100644 --- a/src/Localization/Game.zh-TW.resx +++ b/src/Localization/Game.zh-TW.resx @@ -656,19 +656,19 @@ legacy_id=165 - STR + 力量 legacy_id=166 - 通用人工智慧 + 敏捷 legacy_id=167 - 英語 + 能量 legacy_id=168 - 史塔 + 體力 legacy_id=169 @@ -6225,7 +6225,7 @@ legacy_id=1703 - 活力 + 能量 legacy_id=1704 @@ -6357,7 +6357,7 @@ legacy_id=1737 - 命令 + 統率 legacy_id=1738,1900 diff --git a/src/bin/Data/Items/Group14_Potion.json b/src/bin/Data/Items/Group14_Potion.json index ed88afcfae..e9a513255a 100644 --- a/src/bin/Data/Items/Group14_Potion.json +++ b/src/bin/Data/Items/Group14_Potion.json @@ -171,7 +171,7 @@ "de": "Effekt: Schaden +20%", "es": "Daño +20% efecto de aumento", "id": "Kerusakan +20% meningkatkan efek", - "ja": "攻撃力+20%上昇效果", + "ja": "攻撃力+20%上昇効果", "pl": "Efekt zwiększenia obrażeń o 20%", "pt": "Dano +20% efeito de aumento", "ru": "Урон +20% увеличение эффекта", diff --git a/tests/data/test_item_database_files.cpp b/tests/data/test_item_database_files.cpp index 53fc826f94..462fa9372d 100644 --- a/tests/data/test_item_database_files.cpp +++ b/tests/data/test_item_database_files.cpp @@ -862,11 +862,12 @@ TEST_CASE("The second item chain's tooltip texts keep their translations [data][ } // What the old code printed for an item's level lines in the UI's language, where the texts are the game's that other -// code still prints: one entry per line of OldLevelLines, empty for a text only the tooltip had (removed since). The -// Fruits' stat lines aren't compared: their stat words are corrected here, and stay wrong in the game's texts. +// code still prints: one entry per line of OldLevelLines, empty for a text only the tooltip had (removed since). A +// Fruit's stat lines started with the stat's name; the rest of them was a removed text. struct PrintedOldLine { std::string text; + bool isPrefix = false; }; std::string PrintWithName(const wchar_t* format, const wchar_t* name) @@ -892,8 +893,10 @@ std::vector> PrintedOldLevelLines(int group, int n } if (group == 13 && number == 15 && level <= 4) { - std::vector> lines = {std::nullopt, std::nullopt, - printed(I18N::Game::ItCanBeUsedWithItemRemoved)}; + const wchar_t* const stats[] = {I18N::Game::ENG, I18N::Game::STA, I18N::Game::AGI, I18N::Game::STR, + I18N::Game::Command}; + const PrintedOldLine stat{Core::Text::ToUtf8(stats[level]) + " ", true}; + std::vector> lines = {stat, stat, printed(I18N::Game::ItCanBeUsedWithItemRemoved)}; if (level == 4) { lines.push_back(PrintedOldLine{PrintWithName(I18N::Game::CanBeEquippedByS, I18N::Game::DarkLord)}); @@ -941,16 +944,23 @@ TEST_CASE("The tooltip texts by item level are the game's texts in every languag continue; } const std::string text = FilledLine(*found, *shown[index], level, profiles, locale); - CHECK(text == old[index]->text); + if (old[index]->isPrefix) + { + CHECK(text.starts_with(old[index]->text)); + } + else + { + CHECK(text == old[index]->text); + } ++compared; } } I18N::SetLocale("en"); } } - // Archer and Spearman, Scroll of Guardian and Place Life Stone, and the Fruits' last line at +0 to +3 and last two - // at +4, in every language. - CHECK(compared == (2 + 2 + 4 * 1 + 2) * static_cast(std::size(I18N::GetAvailableLocales()))); + // Archer and Spearman, Scroll of Guardian and Place Life Stone, and the Fruits' 3 lines at +0 to +3 and 4 at +4, in + // every language. + CHECK(compared == (2 + 2 + 4 * 3 + 4) * static_cast(std::size(I18N::GetAvailableLocales()))); } // The damage texts without the English "of" and the Fruits' stat words, as #828 fixed them: rendered with 12 in each