Skip to content

Commit

Permalink
Add fallback string for close window dialog (#1087)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Robertz <dream-master@gmx.net>
  • Loading branch information
wlhlm and Dream-Master authored Nov 24, 2024
1 parent 3c3451b commit 8c3e21c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import javax.swing.JOptionPane;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.StatCollector;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
Expand Down Expand Up @@ -48,7 +48,12 @@ public class MixinMinecraft_ConfirmExit {
final ImageIcon imageIcon = resource == null ? null : new ImageIcon(resource);
final int result = JOptionPane.showConfirmDialog(
frame,
I18n.format("dreamcraft.gui.quitmessage"),
// When FML encounters an error, the only way to close the window is through the close button,
// which will show this message, unfortunately at this point, no localisations will have been
// loaded, so we add a hardcoded fallback message here.
StatCollector.canTranslate("dreamcraft.gui.quitmessage")
? StatCollector.translateToLocal("dreamcraft.gui.quitmessage")
: "Are you sure you want to exit the game?",
Refstrings.NAME,
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/dreamcraft/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ item.tconstruct.manual.weaponry.part_materials=\n\nValid Shaft Materials:\n* Sti
item.tconstruct.manual.weaponry.bolts=\n\nBolts:\nCrafting bolts is a delicate process. First you need a core in the form of a tool rod.\nTake this tool rod to a smeltery and put it into a Casting Table. Pour some metal onto it to coat the tip with a more damaging material.\nAfter this process, add a fletching and your bolts are ready to be used.\n\nSince the bolts consist of a harder core and tip they carry more weight than regular arrows, making them perfect to fight armored targets.

dreamcraft.mobsinfocompat.limitedropcount=Drops only %s times per person
dreamcraft.gui.quitmessage=Are you sure you want to exit the game ?
dreamcraft.gui.quitmessage=Are you sure you want to exit the game?

dreamcraft.welcome.welcome=Welcome to Gregtech: New Horizons
dreamcraft.welcome.questbook=The Quest Book has a shortcut key, check your keybindings.
Expand All @@ -1751,4 +1751,4 @@ dreamcraft.welcome.visitdiscord=Visit our discord at
dreamcraft.welcome.click_discord=Click to open discord!

dreamcraft.pausemenu.bug=Report a Bug
dreamcraft.pausemenu.wiki=Open the Wiki
dreamcraft.pausemenu.wiki=Open the Wiki

0 comments on commit 8c3e21c

Please sign in to comment.