From 0d233e2c338ad057e104730ab535d8e59d10bf3c Mon Sep 17 00:00:00 2001 From: jamssismy <126220036+jamssismy@users.noreply.github.com> Date: Thu, 27 Feb 2025 10:02:34 +0800 Subject: [PATCH 1/3] Update mod_congratsonlevel.cpp The software or game now supports user interface prompts in both Simplified Chinese and Traditional Chinese, making it more accessible to a wider range of Chinese-speaking users. A correction has been made to the on-screen display of currency amounts. Specifically, where small amounts of currency were being shown, the unit was incorrectly displayed as "Gold." This has been corrected so that it now accurately displays "Copper," which is the appropriate unit for smaller denominations in games like World of Warcraft. --- src/mod_congratsonlevel.cpp | 58 ++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index 9f49ac1..0b490ca 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -182,7 +182,23 @@ public: case LOCALE_frFR: case LOCALE_deDE: case LOCALE_zhCN: + { + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " + << player->GetName() + << " |cffFFFFFF已达到 |cff4CFF00" + << std::to_string(player->GetLevel()) + << " 级|cffFFFFFF!"; + break; +} case LOCALE_zhTW: + { + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " + << player->GetName() + << " |cffFFFFFF已達到 |cff4CFF00" + << std::to_string(player->GetLevel()) + << " 級|cffFFFFFF!"; + break; +} case LOCALE_ruRU: { ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << std::to_string(player->GetLevel()) << "|cffFFFFFF!"; @@ -210,17 +226,33 @@ public: case LOCALE_koKR: case LOCALE_frFR: case LOCALE_deDE: - case LOCALE_zhCN: - case LOCALE_zhTW: + case LOCALE_zhCN: // 简体中文 +{ + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " + << player->GetName() + << " |cffFFFFFF已达到 |cff4CFF00" + << static_cast(player->GetLevel()) + << " 级|cffFFFFFF!"; + break; +} +case LOCALE_zhTW: // 繁体中文 +{ + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " + << player->GetName() + << " |cffFFFFFF已達到 |cff4CFF00" + << static_cast(player->GetLevel()) + << " 級|cffFFFFFF!"; + break; +} case LOCALE_ruRU: { - ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << std::to_string(player->GetLevel()) << "|cffFFFFFF!"; + ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; break; } case LOCALE_esES: case LOCALE_esMX: { - ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << std::to_string(player->GetLevel()) << "|cffFFFFFF!"; + ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; } default: break; @@ -235,17 +267,27 @@ public: case LOCALE_koKR: case LOCALE_frFR: case LOCALE_deDE: - case LOCALE_zhCN: - case LOCALE_zhTW: + case LOCALE_zhCN: // 简体中文 +{ + ss2 << "恭喜达到等级 " << static_cast(player->GetLevel()) << "," << player->GetName() + << "!您获得了 " << money << " 钱币和一些宝藏!"; + break; +} +case LOCALE_zhTW: // 繁体中文 +{ + ss2 << "恭喜達到等級 " << static_cast(player->GetLevel()) << "," << player->GetName() + << "!您獲得了 " << money << " 錢幣和一些寶藏!"; + break; +} case LOCALE_ruRU: { - ss2 << "Congrats on Level " << std::to_string(player->GetLevel()) << " " << player->GetName() << "! You've been awarded " << money << " gold and a few treasures!"; + ss2 << "Congrats on Level " << static_cast(player->GetLevel()) << " " << player->GetName() << "! You've been awarded " << money << " Copper and a few treasures!"; break; } case LOCALE_esES: case LOCALE_esMX: { - ss2 << "¡Felicidades por el nivel " << std::to_string(player->GetLevel()) << " " << player->GetName() << " Se le ha concedido " << money << " oro y unos cuantos tesoros!"; + ss2 << "¡Felicidades por el nivel " << static_cast(player->GetLevel()) << " " << player->GetName() << " Se le ha concedido " << money << " cobre y unos cuantos tesoros!"; } default: break; From 4fe199845ee54c7d516d86e542febf9e4e15616a Mon Sep 17 00:00:00 2001 From: jamssismy <126220036+jamssismy@users.noreply.github.com> Date: Thu, 27 Feb 2025 16:41:14 +0800 Subject: [PATCH 2/3] Update mod_congratsonlevel.cpp The calling method for levels has been standardized << static_cast(player->GetLevel()) << --- src/mod_congratsonlevel.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index 0b490ca..0783deb 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -186,8 +186,7 @@ public: ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已达到 |cff4CFF00" - << std::to_string(player->GetLevel()) - << " 级|cffFFFFFF!"; + << static_cast(player->GetLevel()) << " 级|cffFFFFFF!"; break; } case LOCALE_zhTW: @@ -195,19 +194,18 @@ public: ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已達到 |cff4CFF00" - << std::to_string(player->GetLevel()) - << " 級|cffFFFFFF!"; + << static_cast(player->GetLevel()) << " 級|cffFFFFFF!"; break; } case LOCALE_ruRU: { - ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << std::to_string(player->GetLevel()) << "|cffFFFFFF!"; + ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; break; } case LOCALE_esES: case LOCALE_esMX: { - ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << std::to_string(player->GetLevel()) << "|cffFFFFFF!"; + ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; } default: break; From ae5e5d3b28dcda796d1094450adecfcbe05a30a8 Mon Sep 17 00:00:00 2001 From: jamssismy <126220036+jamssismy@users.noreply.github.com> Date: Fri, 28 Feb 2025 11:29:09 +0800 Subject: [PATCH 3/3] Update mod_congratsonlevel.cpp I aligned the code, and actually, our communication is done through AI translation. I initially thought your mention of alignment referred to the unification of the level display function calls. Thank you for the reminder. I'm not a professional programmer and haven't received formal training, so I don't have good code alignment habits. Thanks again for your reminder!~ --- src/mod_congratsonlevel.cpp | 64 ++++++++++++++----------------------- 1 file changed, 24 insertions(+), 40 deletions(-) diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index 0783deb..1a5a9cb 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -183,20 +183,14 @@ public: case LOCALE_deDE: case LOCALE_zhCN: { - ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " - << player->GetName() - << " |cffFFFFFF已达到 |cff4CFF00" - << static_cast(player->GetLevel()) << " 级|cffFFFFFF!"; - break; -} + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已达到 |cff4CFF00" << static_cast(player->GetLevel()) << " 级|cffFFFFFF!"; + break; + } case LOCALE_zhTW: { - ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " - << player->GetName() - << " |cffFFFFFF已達到 |cff4CFF00" - << static_cast(player->GetLevel()) << " 級|cffFFFFFF!"; - break; -} + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已達到 |cff4CFF00" << static_cast(player->GetLevel()) << " 級|cffFFFFFF!"; + break; + } case LOCALE_ruRU: { ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; @@ -225,23 +219,15 @@ public: case LOCALE_frFR: case LOCALE_deDE: case LOCALE_zhCN: // 简体中文 -{ - ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " - << player->GetName() - << " |cffFFFFFF已达到 |cff4CFF00" - << static_cast(player->GetLevel()) - << " 级|cffFFFFFF!"; - break; -} -case LOCALE_zhTW: // 繁体中文 -{ - ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " - << player->GetName() - << " |cffFFFFFF已達到 |cff4CFF00" - << static_cast(player->GetLevel()) - << " 級|cffFFFFFF!"; - break; -} + { + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已达到 |cff4CFF00" << static_cast(player->GetLevel()) << " 级|cffFFFFFF!"; + break; + } + case LOCALE_zhTW: // 繁体中文 + { + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已達到 |cff4CFF00" << static_cast(player->GetLevel()) << " 級|cffFFFFFF!"; + break; + } case LOCALE_ruRU: { ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; @@ -266,17 +252,15 @@ case LOCALE_zhTW: // 繁体中文 case LOCALE_frFR: case LOCALE_deDE: case LOCALE_zhCN: // 简体中文 -{ - ss2 << "恭喜达到等级 " << static_cast(player->GetLevel()) << "," << player->GetName() - << "!您获得了 " << money << " 钱币和一些宝藏!"; - break; -} -case LOCALE_zhTW: // 繁体中文 -{ - ss2 << "恭喜達到等級 " << static_cast(player->GetLevel()) << "," << player->GetName() - << "!您獲得了 " << money << " 錢幣和一些寶藏!"; - break; -} + { + ss2 << "恭喜达到等级 " << static_cast(player->GetLevel()) << "," << player->GetName() << "!您获得了 " << money << " 钱币和一些宝藏!"; + break; + } + case LOCALE_zhTW: // 繁体中文 + { + ss2 << "恭喜達到等級 " << static_cast(player->GetLevel()) << "," << player->GetName() << "!您獲得了 " << money << " 錢幣和一些寶藏!"; + break; + } case LOCALE_ruRU: { ss2 << "Congrats on Level " << static_cast(player->GetLevel()) << " " << player->GetName() << "! You've been awarded " << money << " Copper and a few treasures!";