From 5c1a5e35b9852c7949c1a65e2afee9a5b2dd33fd Mon Sep 17 00:00:00 2001 From: Lxeon <1277454443@qq.com> Date: Sun, 17 Aug 2025 00:16:03 +0800 Subject: [PATCH] fix geoip chi not return chinese translation (#2335) * fix geoip chi and zho not return chinese translation * optimize code logic: chi and zho as the final return * code optimization --- extensions/geoip/geoip_util.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/geoip/geoip_util.cpp b/extensions/geoip/geoip_util.cpp index 019059577..2af9890ea 100644 --- a/extensions/geoip/geoip_util.cpp +++ b/extensions/geoip/geoip_util.cpp @@ -183,6 +183,10 @@ const char *getLang(int target) if (translator->GetLanguageInfo(langid, &code, NULL)) { + if (strcmp(code, "chi") == 0) + { + code = "zh-CN"; + } for (size_t i = 0; i < mmdb.metadata.languages.count; i++) { if (strcmp(code, mmdb.metadata.languages.names[i]) == 0) @@ -206,4 +210,4 @@ std::string lookupString(const char *ip, const char **path) } return std::string(result.utf8_string, result.data_size); -} \ No newline at end of file +}