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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user