Translating hard-coded text to res en-US.properties

This commit is contained in:
churrufli
2019-01-21 00:43:16 +01:00
parent 07c2065917
commit 8bf2bd6ddc
2 changed files with 32 additions and 26 deletions

View File

@@ -18,6 +18,7 @@ import forge.toolbox.FComboBox;
import forge.toolbox.FComboBoxPanel;
import forge.toolbox.FLabel;
import forge.toolbox.FOptionPane;
import forge.util.Localizer;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
@@ -38,6 +39,8 @@ import java.util.List;
public enum CSubmenuPreferences implements ICDoc {
/** */
SINGLETON_INSTANCE;
final Localizer localizer = Localizer.getInstance();
private VSubmenuPreferences view;
private ForgePreferences prefs;
@@ -66,7 +69,7 @@ public enum CSubmenuPreferences implements ICDoc {
if (updating) { return; }
// prevent changing DEV_MODE while network game running
if (FServerManager.getInstance().isMatchActive()) {
System.out.println("Can't change DEV_MODE while a network match is in progress!");
System.out.println(localizer.getMessage("CantChangeDevModeWhileNetworkMath"));
return;
}
@@ -192,7 +195,7 @@ public enum CSubmenuPreferences implements ICDoc {
public void run() {
prefs.setPref(FPref.DISABLE_DISPLAY_JAVA_8_UPDATE_WARNING, false);
prefs.save();
FOptionPane.showMessageDialog("Compatibility warnings re-enabled!");
FOptionPane.showMessageDialog(localizer.getMessage("CompatibilityWarningsReEnabled"));
}
});
@@ -242,10 +245,8 @@ public enum CSubmenuPreferences implements ICDoc {
}
private void resetForgeSettingsToDefault() {
final String userPrompt =
"This will reset all preferences to their defaults and restart Forge.\n\n" +
"Reset and restart Forge?";
if (FOptionPane.showConfirmDialog(userPrompt, "Reset Settings")) {
final String userPrompt =localizer.getMessage("AresetForgeSettingsToDefault");
if (FOptionPane.showConfirmDialog(userPrompt, localizer.getMessage("TresetForgeSettingsToDefault"))) {
final ForgePreferences prefs = FModel.getPreferences();
prefs.reset();
prefs.save();
@@ -255,38 +256,28 @@ public enum CSubmenuPreferences implements ICDoc {
}
private void resetDeckEditorLayout() {
final String userPrompt =
"This will reset the Deck Editor screen layout.\n" +
"All tabbed views will be restored to their default positions.\n\n" +
"Reset layout?";
if (FOptionPane.showConfirmDialog(userPrompt, "Reset Deck Editor Layout")) {
final String userPrompt =localizer.getMessage("AresetDeckEditorLayout");
if (FOptionPane.showConfirmDialog(userPrompt, localizer.getMessage("TresetDeckEditorLayout"))) {
if (FScreen.DECK_EDITOR_CONSTRUCTED.deleteLayoutFile()) {
FOptionPane.showMessageDialog("Deck Editor layout has been reset.");
FOptionPane.showMessageDialog(localizer.getMessage("OKresetDeckEditorLayout"));
}
}
}
private void resetWorkshopLayout() {
final String userPrompt =
"This will reset the Workshop screen layout.\n" +
"All tabbed views will be restored to their default positions.\n\n" +
"Reset layout?";
if (FOptionPane.showConfirmDialog(userPrompt, "Reset Workshop Layout")) {
final String userPrompt =localizer.getMessage("AresetWorkshopLayout");
if (FOptionPane.showConfirmDialog(userPrompt, localizer.getMessage("TresetWorkshopLayout"))) {
if (FScreen.WORKSHOP_SCREEN.deleteLayoutFile()) {
FOptionPane.showMessageDialog("Workshop layout has been reset.");
FOptionPane.showMessageDialog(localizer.getMessage("OKresetWorkshopLayout"));
}
}
}
private void resetMatchScreenLayout() {
final String userPrompt =
"This will reset the layout of the Match screen.\n" +
"If you want to save the current layout first, please use " +
"the Dock tab -> Save Layout option in the Match screen.\n\n" +
"Reset layout?";
if (FOptionPane.showConfirmDialog(userPrompt, "Reset Match Screen Layout")) {
final String userPrompt =localizer.getMessage("AresetMatchScreenLayout");
if (FOptionPane.showConfirmDialog(userPrompt, localizer.getMessage("TresetMatchScreenLayout"))) {
if (FScreen.deleteMatchLayoutFile()) {
FOptionPane.showMessageDialog("Match Screen layout has been reset.");
FOptionPane.showMessageDialog(localizer.getMessage("OKresetMatchScreenLayout"));
}
}
}