Skip to content

Commit 85ed229

Browse files
authored
code optimization
1 parent abad71c commit 85ed229

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

extensions/geoip/geoip_util.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,17 @@ const char *getLang(int target)
183183

184184
if (translator->GetLanguageInfo(langid, &code, NULL))
185185
{
186+
if (strcmp(code, "chi") == 0)
187+
{
188+
code = "zh-CN";
189+
}
186190
for (size_t i = 0; i < mmdb.metadata.languages.count; i++)
187191
{
188192
if (strcmp(code, mmdb.metadata.languages.names[i]) == 0)
189193
{
190194
return code;
191195
}
192196
}
193-
if (strcmp(code, "chi") == 0 || strcmp(code, "zho") == 0) {
194-
return "zh-CN";
195-
}
196197
}
197198
}
198199

0 commit comments

Comments
 (0)