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
This commit is contained in:
Lxeon
2025-08-16 18:16:03 +02:00
committed by GitHub
parent 392f0a92c7
commit 5c1a5e35b9
+5 -1
View File
@@ -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);
}
}