translate some text

This commit is contained in:
CCTV-1
2020-01-14 13:18:43 +08:00
parent 3f2d70c315
commit 1a55341dd3
19 changed files with 189 additions and 185 deletions

View File

@@ -24,6 +24,7 @@ import java.awt.event.WindowEvent;
import java.awt.event.WindowFocusListener;
import java.util.Collections;
import java.util.List;
import forge.util.Localizer;
import javax.swing.AbstractListModel;
import javax.swing.Icon;
@@ -113,7 +114,7 @@ public class CardListViewer extends FDialog {
this.addWindowFocusListener(new CardListFocuser());
final FButton btnOK = new FButton("OK");
final FButton btnOK = new FButton(Localizer.getInstance().getMessage("lblOK"));
btnOK.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {

View File

@@ -46,6 +46,8 @@ import forge.toolbox.FMouseAdapter;
import forge.toolbox.FOptionPane;
import forge.toolbox.FScrollPane;
import forge.util.Localizer;
/**
* A simple class that shows a list of choices in a dialog. Two properties
* influence the behavior of a list chooser: minSelection and maxSelection.
@@ -60,7 +62,7 @@ import forge.toolbox.FScrollPane;
* disabled.</li>
* <li>The dialog was "committed" if "OK" was clicked or a choice was double
* clicked.</li>
* <li>The dialog was "canceled" if "Cancel" or "X" was clicked.</li>
* <li>The dialog was "canceled" if Localizer.getInstance().getMessage("lblCancel") or "X" was clicked.</li>
* <li>If the dialog was canceled, the selection will be empty.</li>
* <li>
* </ul>
@@ -91,9 +93,9 @@ public class ListChooser<T> {
final ImmutableList<String> options;
if (minChoices == 0) {
options = ImmutableList.of("OK","Cancel");
options = ImmutableList.of(Localizer.getInstance().getMessage("lblOK"),Localizer.getInstance().getMessage("lblCancel"));
} else {
options = ImmutableList.of("OK");
options = ImmutableList.of(Localizer.getInstance().getMessage("lblOK"));
}
if (maxChoices == 1 || minChoices == -1) {

View File

@@ -21,6 +21,7 @@ import forge.toolbox.FSkin;
import forge.toolbox.FSkin.SkinnedPanel;
import forge.toolbox.FTextField;
import forge.toolbox.LayoutHelper;
import forge.util.Localizer;
import javax.swing.*;
@@ -89,7 +90,7 @@ public class AdvancedSearchFilter<T extends InventoryItem> extends ItemFilter<T>
GuiUtils.addSeparator(menu);
}
GuiUtils.addMenuItem(menu, "Edit Expression", null, new Runnable() {
GuiUtils.addMenuItem(menu, Localizer.getInstance().getMessage("lblEditExpression"), null, new Runnable() {
@Override
public void run() {
edit();
@@ -97,7 +98,7 @@ public class AdvancedSearchFilter<T extends InventoryItem> extends ItemFilter<T>
});
if (hasFilters) {
GuiUtils.addMenuItem(menu, "Clear Filter", null, new Runnable() {
GuiUtils.addMenuItem(menu, Localizer.getInstance().getMessage("lblClearFilter"), null, new Runnable() {
@Override
public void run() {
reset();
@@ -173,7 +174,7 @@ public class AdvancedSearchFilter<T extends InventoryItem> extends ItemFilter<T>
}
private boolean show() {
optionPane = new FOptionPane(null, "Advanced Search", null, scroller, ImmutableList.of("OK", "Cancel"), 0);
optionPane = new FOptionPane(null, Localizer.getInstance().getMessage("lblAdvancedSearch"), null, scroller, ImmutableList.of(Localizer.getInstance().getMessage("lblOK"), Localizer.getInstance().getMessage("lblCancel")), 0);
optionPane.addComponentListener(new ComponentAdapter() {
@Override
public void componentShown(ComponentEvent e) {

View File

@@ -7,6 +7,7 @@ import forge.gui.SOverlayUtils;
import forge.model.FModel;
import forge.toolbox.*;
import forge.util.TextUtil;
import forge.util.Localizer;
import net.miginfocom.swing.MigLayout;
import javax.swing.*;
@@ -24,7 +25,7 @@ public class DialogChooseSets {
private Runnable okCallback;
private final List<FCheckBox> choices = new ArrayList<>();
private final FCheckBox cbWantReprints = new FCheckBox("Display compatible reprints from more recent sets");
private final FCheckBox cbWantReprints = new FCheckBox(Localizer.getInstance().getMessage("lblDisplayRecentSetRepints"));
// lists are of set codes (e.g. "2ED")
public DialogChooseSets(Collection<String> preselectedSets, Collection<String> unselectableSets, boolean showWantReprintsCheckbox) {
@@ -76,21 +77,21 @@ public class DialogChooseSets {
optionsPanel.setVisible(false);
optionsPanel.setOpaque(false);
optionsPanel.add(new JSeparator(SwingConstants.HORIZONTAL), "w 100%, span 2, growx");
optionsPanel.add(new FLabel.Builder().text("Select Random Sets").fontSize(17).fontStyle(Font.BOLD).build(), "h 40!, span 2");
optionsPanel.add(new FLabel.Builder().text(Localizer.getInstance().getMessage("lblSelectRandomSets")).fontSize(17).fontStyle(Font.BOLD).build(), "h 40!, span 2");
JPanel leftOptionsPanel = new JPanel(new MigLayout("insets 10, gap 5, center, wrap 2"));
leftOptionsPanel.setOpaque(false);
leftOptionsPanel.add(new FLabel.Builder().text("Number to Select:").fontSize(14).fontStyle(Font.BOLD).build(), " span 2");
leftOptionsPanel.add(new FLabel.Builder().text("Core:").build());
leftOptionsPanel.add(new FLabel.Builder().text(Localizer.getInstance().getMessage("lblSelectNumber") + ":").fontSize(14).fontStyle(Font.BOLD).build(), " span 2");
leftOptionsPanel.add(new FLabel.Builder().text(Localizer.getInstance().getMessage("lblCore") + ":").build());
leftOptionsPanel.add(coreField, "w 40!");
leftOptionsPanel.add(new FLabel.Builder().text("Expansion:").build());
leftOptionsPanel.add(new FLabel.Builder().text(Localizer.getInstance().getMessage("lblExpansion") + ":").build());
leftOptionsPanel.add(expansionField, "w 40!");
leftOptionsPanel.add(new FLabel.Builder().text("Other:").build());
leftOptionsPanel.add(otherField, "w 40!");
JPanel rightOptionsPanel = new JPanel(new MigLayout("insets 10, gap 25 5, center, wrap 2"));
rightOptionsPanel.setOpaque(false);
rightOptionsPanel.add(new FLabel.Builder().text("Format Restrictions:").fontSize(14).fontStyle(Font.BOLD).build(), "span 2");
rightOptionsPanel.add(new FLabel.Builder().text(Localizer.getInstance().getMessage("lblFormatRestrictions") +":").fontSize(14).fontStyle(Font.BOLD).build(), "span 2");
ButtonGroup formatButtonGroup = new ButtonGroup();
List<GameFormat> gameFormats = new ArrayList<>();
@@ -98,7 +99,7 @@ public class DialogChooseSets {
gameFormats.forEach(item -> {
if (item.getName().equals("Legacy")) {
FRadioButton button = new FRadioButton("Legacy/Vintage");
FRadioButton button = new FRadioButton(Localizer.getInstance().getMessage("lblLegacyOrVintage"));
button.setActionCommand(item.getName());
formatButtonGroup.add(button);
rightOptionsPanel.add(button);
@@ -110,12 +111,12 @@ public class DialogChooseSets {
}
});
FRadioButton button = new FRadioButton("Modern Card Frame");
FRadioButton button = new FRadioButton(Localizer.getInstance().getMessage("lblModernCardFrame"));
button.setActionCommand("Modern Card Frame");
formatButtonGroup.add(button);
rightOptionsPanel.add(button);
FRadioButton noFormatSelectionButton = new FRadioButton("No Format Restriction");
FRadioButton noFormatSelectionButton = new FRadioButton(Localizer.getInstance().getMessage("lblNoFormatRestriction"));
noFormatSelectionButton.setActionCommand("No Format Restriction");
formatButtonGroup.add(noFormatSelectionButton);
rightOptionsPanel.add(noFormatSelectionButton);
@@ -124,7 +125,7 @@ public class DialogChooseSets {
optionsPanel.add(leftOptionsPanel, "w 33%:40%:78%");
optionsPanel.add(rightOptionsPanel, "w 33%:60%:78%");
FButton randomSelectionButton = new FButton("Randomize Sets");
FButton randomSelectionButton = new FButton(Localizer.getInstance().getMessage("lblRandomizeSets"));
randomSelectionButton.addActionListener(actionEvent -> {
int numberOfCoreSets = Integer.parseInt(coreField.getText());
@@ -214,7 +215,7 @@ public class DialogChooseSets {
});
FButton clearSelectionButton = new FButton("Clear Selection");
FButton clearSelectionButton = new FButton(Localizer.getInstance().getMessage("lblClearSelection"));
clearSelectionButton.addActionListener(actionEvent -> {
for (FCheckBox coreSet : coreSets) {
coreSet.setSelected(false);
@@ -228,13 +229,13 @@ public class DialogChooseSets {
panel.repaintSelf();
});
FButton showOptionsButton = new FButton("Show Options");
FButton showOptionsButton = new FButton(Localizer.getInstance().getMessage("lblShowOptions"));
showOptionsButton.addActionListener(actionEvent -> {
optionsPanel.setVisible(true);
showOptionsButton.setVisible(false);
});
FButton hideOptionsButton = new FButton("Hide Options");
FButton hideOptionsButton = new FButton(Localizer.getInstance().getMessage("lblHideOptions"));
hideOptionsButton.addActionListener(actionEvent -> {
optionsPanel.setVisible(false);
showOptionsButton.setVisible(true);
@@ -254,12 +255,12 @@ public class DialogChooseSets {
optionsPanel.add(new JSeparator(SwingConstants.HORIZONTAL), "w 100%, span 2, growx");
panel.add(new FLabel.Builder().text("Choose sets").fontSize(20).build(), "center, span, wrap, gaptop 10");
panel.add(new FLabel.Builder().text(Localizer.getInstance().getMessage("lblChooseSets")).fontSize(20).build(), "center, span, wrap, gaptop 10");
String constraints = "aligny top";
panel.add(makeCheckBoxList(coreSets, "Core sets", true), constraints);
panel.add(makeCheckBoxList(expansionSets, "Expansions", false), constraints);
panel.add(makeCheckBoxList(otherSets, "Other sets", false), constraints);
panel.add(makeCheckBoxList(coreSets, Localizer.getInstance().getMessage("lblCoreSets"), true), constraints);
panel.add(makeCheckBoxList(expansionSets, Localizer.getInstance().getMessage("lblExpansions"), false), constraints);
panel.add(makeCheckBoxList(otherSets, Localizer.getInstance().getMessage("lblOtherSets"), false), constraints);
panel.add(showOptionsButton, "center, w 230!, h 30!, gap 10 0 20 0, span 3, hidemode 3");
panel.add(optionsPanel, "center, w 100, span 3, growx, hidemode 3");
@@ -273,7 +274,7 @@ public class DialogChooseSets {
}
};
FButton btnOk = new FButton("OK");
FButton btnOk = new FButton(Localizer.getInstance().getMessage("lblOK"));
btnOk.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
@@ -282,7 +283,7 @@ public class DialogChooseSets {
}
});
FButton btnCancel = new FButton("Cancel");
FButton btnCancel = new FButton(Localizer.getInstance().getMessage("lblCancel"));
btnCancel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {

View File

@@ -77,7 +77,7 @@ public enum VSubmenuSealed implements IVSubmenu<CSubmenuSealed> {
private final FLabel btnDirections = new FLabel.Builder()
.fontSize(16).opaque(true).hoverable(true)
.text("How To Play").fontAlign(SwingConstants.CENTER).build();
.text(localizer.getMessage("lblHowtoPlay")).fontAlign(SwingConstants.CENTER).build();
/**
* Constructor.
@@ -181,15 +181,7 @@ public enum VSubmenuSealed implements IVSubmenu<CSubmenuSealed> {
final JPanel overlay = SOverlayUtils.genericOverlay();
final int w = overlay.getWidth();
final String instructions = "SEALED DECK MODE INSTRUCTIONS"
+ "\r\n\r\n"
+ "In Sealed Deck tournaments, each player receives six booster packs"
+ "from which to build their deck."
+ "\r\n\r\n"
+ "Depending on which sets are to be used in a sealed deck event, "
+ "the distribution of packs can vary greatly."
+ "\r\n\r\n"
+ "Credit: Wikipedia";
final String instructions = localizer.getMessage("lblSealedModeInstruction");
// Init directions text pane
final SkinnedTextPane tpnDirections = new SkinnedTextPane();
@@ -207,7 +199,7 @@ public enum VSubmenuSealed implements IVSubmenu<CSubmenuSealed> {
StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
doc.setParagraphAttributes(0, doc.getLength(), center, false);
final JButton btnCloseBig = new FButton("OK");
final JButton btnCloseBig = new FButton(localizer.getMessage("lblOK"));
btnCloseBig.setBounds(new Rectangle((w / 2 - 100), 510, 200, 30));
btnCloseBig.addActionListener(new ActionListener() { @Override
public void actionPerformed(final ActionEvent arg0) { SOverlayUtils.hideOverlay(); } });

View File

@@ -186,7 +186,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
p.setOpaque(false);
p.setBackgroundTexture(FSkin.getIcon(FSkinProp.BG_TEXTURE));
final FButton btnClose = new FButton("OK");
final FButton btnClose = new FButton(localizer.getMessage("lblOK"));
btnClose.addActionListener(new ActionListener() { @Override
public void actionPerformed(final ActionEvent arg0) { SOverlayUtils.hideOverlay(); } });

View File

@@ -126,6 +126,7 @@ import forge.util.ITriggerEvent;
import forge.util.collect.FCollection;
import forge.util.collect.FCollectionView;
import forge.util.gui.SOptionPane;
import forge.util.Localizer;
import forge.view.FView;
import forge.view.arcane.CardPanel;
import forge.view.arcane.FloatingZone;
@@ -460,53 +461,53 @@ public final class CMatchUI
public Iterable<PlayerZoneUpdate> tempShowZones(final PlayerView controller, final Iterable<PlayerZoneUpdate> zonesToUpdate) {
for (final PlayerZoneUpdate update : zonesToUpdate) {
final PlayerView player = update.getPlayer();
for (final ZoneType zone : update.getZones()) {
switch (zone) {
case Battlefield: // always shown
break;
case Hand: // controller hand always shown
if (controller != player) {
FloatingZone.show(this,player,zone);
}
break;
case Library:
case Graveyard:
case Exile:
case Flashback:
case Command:
FloatingZone.show(this,player,zone);
break;
default:
break;
}
}
}
return zonesToUpdate; //pfps should return only the newly shown zones
for (final ZoneType zone : update.getZones()) {
switch (zone) {
case Battlefield: // always shown
break;
case Hand: // controller hand always shown
if (controller != player) {
FloatingZone.show(this,player,zone);
}
break;
case Library:
case Graveyard:
case Exile:
case Flashback:
case Command:
FloatingZone.show(this,player,zone);
break;
default:
break;
}
}
}
return zonesToUpdate; //pfps should return only the newly shown zones
}
@Override
public void hideZones(final PlayerView controller, final Iterable<PlayerZoneUpdate> zonesToUpdate) {
if ( zonesToUpdate != null ) {
for (final PlayerZoneUpdate update : zonesToUpdate) {
final PlayerView player = update.getPlayer();
for (final ZoneType zone : update.getZones()) {
switch (zone) {
case Battlefield: // always shown
break;
case Hand: // the controller's hand should never be temporarily shown, but ...
case Library:
case Graveyard:
case Exile:
case Flashback:
case Command:
FloatingZone.hide(this,player,zone);
break;
default:
break;
}
}
}
}
if ( zonesToUpdate != null ) {
for (final PlayerZoneUpdate update : zonesToUpdate) {
final PlayerView player = update.getPlayer();
for (final ZoneType zone : update.getZones()) {
switch (zone) {
case Battlefield: // always shown
break;
case Hand: // the controller's hand should never be temporarily shown, but ...
case Library:
case Graveyard:
case Exile:
case Flashback:
case Command:
FloatingZone.hide(this,player,zone);
break;
default:
break;
}
}
}
}
}
// Player's mana pool changes
@@ -550,7 +551,7 @@ public final class CMatchUI
}
break;
default:
FloatingZone.refresh(c.getController(),zone); // in case the card is visible in the zone
FloatingZone.refresh(c.getController(),zone); // in case the card is visible in the zone
break;
}
}
@@ -561,18 +562,18 @@ public final class CMatchUI
super.setSelectables(cards);
// update zones on tabletop and floating zones - non-selectable cards may be rendered differently
FThreads.invokeInEdtNowOrLater(new Runnable() {
@Override public final void run() {
for (final PlayerView p : getGameView().getPlayers()) {
if ( p.getCards(ZoneType.Battlefield) != null ) {
updateCards(p.getCards(ZoneType.Battlefield));
}
if ( p.getCards(ZoneType.Hand) != null ) {
updateCards(p.getCards(ZoneType.Hand));
}
}
FloatingZone.refreshAll();
}
});
@Override public final void run() {
for (final PlayerView p : getGameView().getPlayers()) {
if ( p.getCards(ZoneType.Battlefield) != null ) {
updateCards(p.getCards(ZoneType.Battlefield));
}
if ( p.getCards(ZoneType.Hand) != null ) {
updateCards(p.getCards(ZoneType.Hand));
}
}
FloatingZone.refreshAll();
}
});
}
@Override
@@ -580,18 +581,18 @@ public final class CMatchUI
super.clearSelectables();
// update zones on tabletop and floating zones - non-selectable cards may be rendered differently
FThreads.invokeInEdtNowOrLater(new Runnable() {
@Override public final void run() {
for (final PlayerView p : getGameView().getPlayers()) {
if ( p.getCards(ZoneType.Battlefield) != null ) {
updateCards(p.getCards(ZoneType.Battlefield));
}
if ( p.getCards(ZoneType.Hand) != null ) {
updateCards(p.getCards(ZoneType.Hand));
}
}
FloatingZone.refreshAll();
}
});
@Override public final void run() {
for (final PlayerView p : getGameView().getPlayers()) {
if ( p.getCards(ZoneType.Battlefield) != null ) {
updateCards(p.getCards(ZoneType.Battlefield));
}
if ( p.getCards(ZoneType.Hand) != null ) {
updateCards(p.getCards(ZoneType.Hand));
}
}
FloatingZone.refreshAll();
}
});
}
@@ -857,7 +858,7 @@ public final class CMatchUI
if (abilities.size() == 1) {
return abilities.get(0);
}
return GuiChoose.oneOrNone("Choose ability to play", abilities);
return GuiChoose.oneOrNone(Localizer.getInstance().getMessage("lblChooseAbilityToPlay"), abilities);
}
if (abilities.isEmpty()) {
@@ -871,7 +872,7 @@ public final class CMatchUI
}
//show menu if mouse was trigger for ability
final JPopupMenu menu = new JPopupMenu("Abilities");
final JPopupMenu menu = new JPopupMenu(Localizer.getInstance().getMessage("lblAbilities"));
boolean enabled;
int firstEnabled = -1;
@@ -1071,7 +1072,7 @@ public final class CMatchUI
if (delayedReveal != null) {
reveal(delayedReveal.getMessagePrefix(), delayedReveal.getCards()); //TODO: Merge this into search dialog
}
return (List<GameEntityView>) order(title,"Selected", optionList.size() - max, optionList.size() - min, optionList, null, null, false);
return (List<GameEntityView>) order(title,Localizer.getInstance().getMessage("lblSelected"), optionList.size() - max, optionList.size() - min, optionList, null, null, false);
}
@Override
@@ -1228,7 +1229,7 @@ public final class CMatchUI
Dimension maxSize = new Dimension(1400, parentSize.height - 100);
mainPanel.setMaximumSize(maxSize);
mainPanel.setOpaque(false);
// Big Image
addBigImageToStackModalPanel(mainPanel, si);
@@ -1256,7 +1257,7 @@ public final class CMatchUI
numSmallImages++;
}
}
}
}
// If current effect is a triggered ability, I want to show the triggering card if present
SpellAbility sourceSA = (SpellAbility) si.getTriggeringObject(AbilityKey.SourceSA);
@@ -1265,7 +1266,7 @@ public final class CMatchUI
sourceCardView = sourceSA.getHostCard().getView();
numSmallImages++;
}
// I also want to show each type of targets (both cards and players)
List<GameEntityView> targets = getTargets(si,new ArrayList<GameEntityView>());
numSmallImages = numSmallImages + targets.size();
@@ -1281,7 +1282,7 @@ public final class CMatchUI
addSmallImageToStackModalPanel(gev, mainPanel, numSmallImages);
}
FOptionPane.showOptionDialog(null, "Forge", null, mainPanel, ImmutableList.of("OK"));
FOptionPane.showOptionDialog(null, "Forge", null, mainPanel, ImmutableList.of(Localizer.getInstance().getMessage("lblOK")));
// here the user closed the modal - time to update the next notifiable stack index
}

View File

@@ -16,6 +16,7 @@ import forge.toolbox.FList;
import forge.toolbox.FOptionPane;
import forge.toolbox.FScrollPane;
import forge.view.FDialog;
import forge.util.Localizer;
@SuppressWarnings("serial")
public class VAutoYields extends FDialog {
@@ -32,7 +33,7 @@ public class VAutoYields extends FDialog {
public VAutoYields(final CMatchUI matchUI) {
super();
setTitle("Auto-Yields");
setTitle(Localizer.getInstance().getMessage("lblAutoYields"));
autoYields = new ArrayList<>();
for (final String autoYield : matchUI.getAutoYields()) {
@@ -47,7 +48,7 @@ public class VAutoYields extends FDialog {
listScroller = new FScrollPane(lstAutoYields, true);
chkDisableAll = new FCheckBox("Disable All Auto Yields", matchUI.getDisableAutoYields());
chkDisableAll = new FCheckBox(Localizer.getInstance().getMessage("lblDisableAllAutoYields"), matchUI.getDisableAutoYields());
chkDisableAll.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
@@ -55,14 +56,14 @@ public class VAutoYields extends FDialog {
}
});
btnOk = new FButton("OK");
btnOk = new FButton(Localizer.getInstance().getMessage("lblOK"));
btnOk.setCommand(new UiCommand() {
@Override
public void run() {
setVisible(false);
}
});
btnRemove = new FButton("Remove Yield");
btnRemove = new FButton(Localizer.getInstance().getMessage("lblRemoveYield"));
btnRemove.setCommand(new UiCommand() {
@Override
public void run() {
@@ -115,7 +116,7 @@ public class VAutoYields extends FDialog {
setVisible(true);
dispose();
} else {
FOptionPane.showMessageDialog("There are no active auto-yields.", "No Auto-Yields", FOptionPane.INFORMATION_ICON);
FOptionPane.showMessageDialog(Localizer.getInstance().getMessage("lblNoActiveAutoYield"), Localizer.getInstance().getMessage("lblNoAutoYield"), FOptionPane.INFORMATION_ICON);
}
}
}

View File

@@ -20,6 +20,7 @@ import com.google.common.collect.ImmutableList;
import forge.assets.FSkinProp;
import forge.toolbox.FSkin.SkinImage;
import forge.view.FDialog;
import forge.util.Localizer;
/**
* Class to replace JOptionPane using skinned dialogs
@@ -49,7 +50,7 @@ public class FOptionPane extends FDialog {
}
public static void showMessageDialog(final String message, final String title, final SkinImage icon) {
showOptionDialog(message, title, icon, ImmutableList.of("OK"), 0);
showOptionDialog(message, title, icon, ImmutableList.of(Localizer.getInstance().getMessage("lblOK")), 0);
}
public static boolean showConfirmDialog(final String message) {
@@ -57,11 +58,11 @@ public class FOptionPane extends FDialog {
}
public static boolean showConfirmDialog(final String message, final String title) {
return showConfirmDialog(message, title, "Yes", "No", true);
return showConfirmDialog(message, title, Localizer.getInstance().getMessage("lblYes"), Localizer.getInstance().getMessage("lblNo"), true);
}
public static boolean showConfirmDialog(final String message, final String title, final boolean defaultYes) {
return showConfirmDialog(message, title, "Yes", "No", defaultYes);
return showConfirmDialog(message, title, Localizer.getInstance().getMessage("lblYes"), Localizer.getInstance().getMessage("lblNo"), defaultYes);
}
public static boolean showConfirmDialog(final String message, final String title, final String yesButtonText, final String noButtonText) {
@@ -124,7 +125,7 @@ public class FOptionPane extends FDialog {
inputField = cbInput;
}
final FOptionPane optionPane = new FOptionPane(message, title, icon, inputField, ImmutableList.of("OK", "Cancel"), -1);
final FOptionPane optionPane = new FOptionPane(message, title, icon, inputField, ImmutableList.of(Localizer.getInstance().getMessage("lblOK"), Localizer.getInstance().getMessage("lblCancel")), -1);
optionPane.setDefaultFocus(inputField);
inputField.addKeyListener(new KeyAdapter() { //hook so pressing Enter on field accepts dialog
@Override