Skip to content

Commit 7275f67

Browse files
committed
do not remove the language section
1 parent 50faf55 commit 7275f67

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

src/main/java/org/maxgamer/quickshop/QuickShop.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,7 +1932,6 @@ private void updateConfig(int selectedVersion) throws IOException {
19321932
getConfiguration().set("config-version", ++selectedVersion);
19331933
}
19341934
if (selectedVersion == 143) {
1935-
getConfiguration().set("language", null);
19361935
// if (getConfiguration().get("language") == null) {
19371936
// getConfiguration().set("language", "en-US");
19381937
// }
@@ -1943,7 +1942,6 @@ private void updateConfig(int selectedVersion) throws IOException {
19431942
// Updater set it to true because plugin upgrading
19441943
// Default configuration disable it cause probably fresh install
19451944
getConfiguration().getOrDefault("legacy-updater.shop-sign", true);
1946-
getConfiguration().set("language", null);
19471945
getConfiguration().set("config-version", ++selectedVersion);
19481946
}
19491947
if (selectedVersion == 145) {
@@ -1952,6 +1950,14 @@ private void updateConfig(int selectedVersion) throws IOException {
19521950
getConfiguration().set("logger.location", 0);
19531951
getConfiguration().set("config-version", ++selectedVersion);
19541952
}
1953+
if (selectedVersion == 146) {
1954+
// Updater set it to true because plugin upgrading
1955+
// Default configuration disable it cause probably fresh install
1956+
if (StringUtils.isEmpty(getConfiguration().getString("language"))) {
1957+
getConfiguration().set("language", "en_us");
1958+
}
1959+
getConfiguration().set("config-version", ++selectedVersion);
1960+
}
19551961
if (getConfiguration().getInt("matcher.work-type") != 0 && GameVersion.get(ReflectFactory.getServerVersion()).name().contains("1_16")) {
19561962
getLogger().warning("You are not using QS Matcher, it may meeting item comparing issue mentioned there: https://hub.spigotmc.org/jira/browse/SPIGOT-5063");
19571963
}

src/main/java/org/maxgamer/quickshop/localization/text/SimpleTextManager.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public SimpleTextManager(QuickShop plugin) {
6666
plugin.getLogger().info("Translation over-the-air platform selected: Crowdin");
6767
this.distribution = new CrowdinOTA(plugin);
6868
load();
69-
7069
}
7170

7271
/**
@@ -83,8 +82,10 @@ private File getOverrideFilesFolder(@NotNull String path) {
8382
File moduleFolder = new File(new File(plugin.getDataFolder(), "overrides"), module);
8483
moduleFolder.mkdirs();
8584
File fileFolder = new File(moduleFolder, file.getName());
86-
fileFolder.mkdirs();
87-
return file;
85+
if (fileFolder.isDirectory())
86+
fileFolder.delete();
87+
// fileFolder.mkdirs();
88+
return moduleFolder;
8889
}
8990

9091
/**
@@ -227,8 +228,9 @@ private JsonConfiguration getDistributionConfiguration(@NotNull String distribut
227228
* @throws InvalidConfigurationException File invalid
228229
*/
229230
private JsonConfiguration getOverrideConfiguration(@NotNull String overrideFile, @NotNull String locale) throws IOException, InvalidConfigurationException {
230-
File localOverrideFile = new File(getOverrideFilesFolder(overrideFile.replace("%locale%", locale)), locale + ".json");
231+
File localOverrideFile = new File(getOverrideFilesFolder(overrideFile.replace("%locale%", locale)), new File(overrideFile.replace("%locale%", locale)).getName());
231232
if (!localOverrideFile.exists()) {
233+
Util.debugLog("Creating locale override file: " + localOverrideFile);
232234
localOverrideFile.getParentFile().mkdirs();
233235
localOverrideFile.createNewFile();
234236
}

src/main/resources/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# QuickShop-Reremake Plugin Configuration
22

33
#Do not touch this if you don't know what you're doing!
4-
config-version: 146
4+
config-version: 147
5+
6+
language: en_us
57

68
#This language will used by Item Name, Enchantment Name,
79
#and Potion Effect Name or the text on the shop info sign (nbtapi not installed) and other them related position.

0 commit comments

Comments
 (0)