Skip to content

Commit

Permalink
Please don't be silent on Debug Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
C0D3-M4513R committed Jan 24, 2024
1 parent 8bc2f76 commit 929c4b0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/org/kettingpowered/launcher/lang/I18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import org.jetbrains.annotations.NotNull;
import org.kettingpowered.launcher.Main;

import java.io.IOException;
import java.io.InputStream;
Expand All @@ -26,6 +27,7 @@ public static void load() {

public static void load(boolean silent) {
if (current != null) return;
silent = silent && !Main.DEBUG;

current = Locale.getDefault();

Expand All @@ -41,9 +43,10 @@ public static void load(boolean silent) {
}

private static void loadFile(String langCode, Map<String, String> toAdd, boolean silent) {
silent = silent && !Main.DEBUG;
try (InputStream lang = I18n.class.getClassLoader().getResourceAsStream(LANG_PATH + langCode + ".json")) {
if (lang == null && !silent) {
System.out.println("Language file not found for " + langCode + ", using default");
if (lang == null) {
if (!silent) System.out.println("Language file not found for " + langCode + ", using default");
return;
}

Expand Down

0 comments on commit 929c4b0

Please sign in to comment.