Skip to content

Commit

Permalink
Hotfix for lang
Browse files Browse the repository at this point in the history
  • Loading branch information
Spazzinq committed Mar 18, 2020
1 parent 87b6c11 commit 16ac607
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public class LangManager {
public LangManager(FlightControl pl) {
this.pl = pl;
langFile = new File(pl.getDataFolder(), "lang.yml");
locale = Locale.getDefault();
}

public boolean loadLang() {
Expand All @@ -112,24 +113,21 @@ public boolean loadLang() {
} catch (IOException e) {
e.printStackTrace();
}

pl.getLogger().info("Generated a new lang.yml!");
}
}
} else {
locale = Locale.getDefault();
}

if (locale != null) {
InputStream langResource = pl.getResource("lang_" + locale.getLanguage() + ".yml");
boolean langResourceExists = langResource != null;

if (!langResourceExists) {
pl.getLogger().warning("No custom lang file for " + locale.getDisplayLanguage() + " could be found! Defaulting to English...");
}
InputStream langResource = pl.getResource("lang_" + locale.getLanguage() + ".yml");
boolean langResourceExists = langResource != null;

lang = new CommentConf(langFile, langResourceExists ? langResource : pl.getResource("lang_en.yml"));
pl.getLogger().info("Generated a new lang.yml!");
if (!langResourceExists) {
pl.getLogger().warning("No custom lang file for " + locale.getDisplayLanguage() + " could be found! Defaulting to English...");
}

lang = new CommentConf(langFile, langResourceExists ? langResource : pl.getResource("lang_en.yml"));

// Migrate config messages
if (pl.getConfManager().getConf().isConfigurationSection("messages")) {
migrateFromVersion4();
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

allprojects {
group = 'org.spazzinq'
version = '4.3.1'
version = '4.3.2'
}

subprojects {
Expand Down

0 comments on commit 16ac607

Please sign in to comment.