Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fallback string for close window dialog #1087

Merged
merged 2 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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