diff --git a/src/GakumasLocalify/Local.cpp b/src/GakumasLocalify/Local.cpp index 08f065f..13c01e9 100644 --- a/src/GakumasLocalify/Local.cpp +++ b/src/GakumasLocalify/Local.cpp @@ -39,6 +39,12 @@ namespace GakumasLocal::Local { return Plugin::GetInstance().GetHookInstaller()->localizationFilesDir; } + bool isAllSpace(const std::string& str) { + return std::all_of(str.begin(), str.end(), [](unsigned char c) { + return std::isspace(c); + }); + } + std::string trim(const std::string& str) { auto is_not_space = [](char ch) { return !std::isspace(ch); }; auto start = std::ranges::find_if(str, is_not_space); @@ -343,6 +349,7 @@ namespace GakumasLocal::Local { bool hasNotTrans = false; if (!waitingReplaceTexts.empty()) { for (const auto& i : waitingReplaceTexts) { + if (isAllSpace(i)) continue; std::string searchResult = findInMapIgnoreSpace(i, genericSplitText); if (!searchResult.empty()) { ReplaceNumberComma(&searchResult); diff --git a/src/platformDefine.hpp b/src/platformDefine.hpp index 7f70bb5..a9e4b78 100644 --- a/src/platformDefine.hpp +++ b/src/platformDefine.hpp @@ -11,7 +11,7 @@ #define LogMinVersion ANDROID_LOG_DEBUG -#define PLUGIN_VERSION "3.1.0" +#define PLUGIN_VERSION "3.1.1" #define ADD_HOOK(name, addr) \ name##_Addr = reinterpret_cast(addr); \