Skip to content

Commit

Permalink
im a dumbass
Browse files Browse the repository at this point in the history
* fix language issues without halplibe
* remove unused
* bump to 2.0.2
  • Loading branch information
Flamarine committed Sep 28, 2023
1 parent a542a5d commit 007dcc9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G
# Also makes builds more reliable and less likely to randomly fail.
org.gradle.daemon=false

mod_version=2.0.1
mod_version=2.0.2
mod_group=io.github.turniplabs
mod_name=modmenu-bta

Expand Down
11 changes: 10 additions & 1 deletion src/main/java/io/github/prospector/modmenu/mixin/MixinI18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static InputStream getResourceAsStream(String path) {
)
private void modmenu$addLangEntries(String languageCode, boolean save, CallbackInfo ci) {
Properties entries = ((LanguageAccessor) currentLanguage).getEntries();
String lang = "/lang/modmenu/" + currentLanguage.getId() + ".json";
String lang = "/lang/modmenu/" + currentLanguage.getId() + ".lang";
try (InputStream stream = getResourceAsStream(lang)) {
if (stream != null) {
InputStreamReader r = new InputStreamReader(stream, StandardCharsets.UTF_8);
Expand All @@ -38,5 +38,14 @@ public static InputStream getResourceAsStream(String path) {
} catch (IOException e) {
e.printStackTrace();
}
String defaultLang = "/lang/modmenu/en_US.lang";
try (InputStream stream = getResourceAsStream(defaultLang)) {
if (stream != null) {
InputStreamReader r = new InputStreamReader(stream, StandardCharsets.UTF_8);
((LanguageAccessor) (Object) Language.Default.INSTANCE).getEntries().load(r);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
2 changes: 0 additions & 2 deletions src/main/resources/lang/modmenu/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ modmenu.sorting.ascending=A-Z
modmenu.sorting.decending=Z-A
modmenu.minecraft=Minecraft
modmenu.forge=Forge
modmenu.default.mc.desc.normal=The base game.
modmenu.default.mc.desc.based=The based game.

0 comments on commit 007dcc9

Please sign in to comment.