mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Fix zh-CN GeoIP locale issue
This commit is contained in:
parent
c10b39c1c7
commit
ffc83343fe
@ -155,6 +155,10 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
|
||||
if (config.getBoolean("enable-locale")) {
|
||||
// Get geolocation based on Essentials' locale. If the locale is not avaliable, use "en".
|
||||
String locale = ess.getI18n().getCurrentLocale().toString().replace('_', '-');
|
||||
// This fixes an inconsistency where Essentials uses "zh" but MaxMind expects "zh-CN".
|
||||
if ("zh".equalsIgnoreCase(locale)) {
|
||||
locale = "zh-CN";
|
||||
}
|
||||
mmreader = new DatabaseReader.Builder(databaseFile).locales(Arrays.asList(locale,"en")).build();
|
||||
} else {
|
||||
mmreader = new DatabaseReader.Builder(databaseFile).build();
|
||||
|
Loading…
Reference in New Issue
Block a user