mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-13 22:25:50 +01:00
Adjust locale for invalid ISO code, fixes #1682
This commit is contained in:
parent
3b5dae8466
commit
dca23a4e8a
@ -386,7 +386,7 @@ public class PlannerPrompt extends QuestsEditorNumericPrompt {
|
||||
final TimeZone tz = TimeZone.getTimeZone(date[6]);
|
||||
cal.setTimeZone(tz);
|
||||
final String[] iso = Lang.getISO().split("-");
|
||||
final Locale loc = new Locale(iso[0], iso[1]);
|
||||
final Locale loc = iso.length > 1 ? new Locale(iso[0], iso[1]) : new Locale(iso[0]);
|
||||
final Double zhour = (double) (cal.getTimeZone().getRawOffset() / 60 / 60 / 1000);
|
||||
final String[] sep = String.valueOf(zhour).replace("-", "").split("\\.");
|
||||
final DecimalFormat zoneFormat = new DecimalFormat("00");
|
||||
|
@ -133,7 +133,7 @@ public class Lang {
|
||||
+ File.separator + "strings_new.yml");
|
||||
final boolean exists_new = langFile_new.exists();
|
||||
final LinkedHashMap<String, String> allStrings = new LinkedHashMap<String, String>();
|
||||
if (langFile.exists()) {
|
||||
if (langFile.exists() && iso.split("-").length > 1) {
|
||||
final FileConfiguration config= YamlConfiguration
|
||||
.loadConfiguration(new InputStreamReader(new FileInputStream(langFile), "UTF-8"));
|
||||
FileConfiguration config_new = null;
|
||||
|
Loading…
Reference in New Issue
Block a user