Skip to content

Commit 3081e31

Browse files
committed
fix geoip chi and zho not return chinese translation
1 parent 20642a8 commit 3081e31

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

extensions/geoip/geoip_util.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ const char *getLang(int target)
183183

184184
if (translator->GetLanguageInfo(langid, &code, NULL))
185185
{
186+
if (strcmp(code, "chi") == 0 || strcmp(code, "zho") == 0) {
187+
code = "zh-CN";
188+
}
186189
for (size_t i = 0; i < mmdb.metadata.languages.count; i++)
187190
{
188191
if (strcmp(code, mmdb.metadata.languages.names[i]) == 0)
@@ -206,4 +209,4 @@ std::string lookupString(const char *ip, const char **path)
206209
}
207210

208211
return std::string(result.utf8_string, result.data_size);
209-
}
212+
}

0 commit comments

Comments
 (0)