mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-04 03:25:50 +00:00
Merge pull request #3052 from pop4959/fix-zh-CN-geoip-issue
Fix zh-CN GeoIP locale issue
This commit is contained in:
commit
6c8da20883
1 changed files with 4 additions and 0 deletions
|
@ -155,6 +155,10 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
|
||||||
if (config.getBoolean("enable-locale")) {
|
if (config.getBoolean("enable-locale")) {
|
||||||
// Get geolocation based on Essentials' locale. If the locale is not avaliable, use "en".
|
// Get geolocation based on Essentials' locale. If the locale is not avaliable, use "en".
|
||||||
String locale = ess.getI18n().getCurrentLocale().toString().replace('_', '-');
|
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();
|
mmreader = new DatabaseReader.Builder(databaseFile).locales(Arrays.asList(locale,"en")).build();
|
||||||
} else {
|
} else {
|
||||||
mmreader = new DatabaseReader.Builder(databaseFile).build();
|
mmreader = new DatabaseReader.Builder(databaseFile).build();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue