From 6c4e241b4bac0bd7e5ab290a5976768bbb9457ac Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Mon, 9 Sep 2019 17:28:00 +0300 Subject: [PATCH] Writing new locale now takes locale setting into account --- .../com/djrapitops/plan/settings/locale/LocaleSystem.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/settings/locale/LocaleSystem.java b/Plan/common/src/main/java/com/djrapitops/plan/settings/locale/LocaleSystem.java index 8fc0719e6..5a465dcc1 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/settings/locale/LocaleSystem.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/settings/locale/LocaleSystem.java @@ -105,7 +105,11 @@ public class LocaleSystem implements SubSystem { private void writeNewDefaultLocale(File localeFile) { try { - new LocaleFileWriter(localeFile.exists() ? Locale.fromFile(localeFile) : locale).writeToFile(localeFile); + Locale writing = loadSettingLocale().orElse(locale); + if (localeFile.exists()) { + writing.putAll(Locale.fromFile(localeFile)); + } + new LocaleFileWriter(writing).writeToFile(localeFile); } catch (IOException | IllegalStateException e) { logger.error("Failed to write new Locale file at " + localeFile.getAbsolutePath()); errorHandler.log(L.WARN, this.getClass(), e);