This commit is contained in:
churrufli
2019-02-24 18:27:28 +01:00
9 changed files with 41 additions and 18 deletions

View File

@@ -128,7 +128,7 @@ public class PlayerPanel extends FPanel {
this.add(avatarLabel, "spany 2, width 80px, height 80px");
createNameEditor();
this.add(lobby.newLabel("Name:"), "w 40px, h 30px, gaptop 5px");
this.add(lobby.newLabel(localizer.getMessage("lblName") +":"), "w 40px, h 30px, gaptop 5px");
this.add(txtPlayerName, "h 30px, pushx, growx");
nameRandomiser = createNameRandomizer();
@@ -138,7 +138,7 @@ public class PlayerPanel extends FPanel {
this.add(radioHuman, "gapright 5px");
this.add(radioAi, "wrap");
this.add(lobby.newLabel("Team:"), "w 40px, h 30px");
this.add(lobby.newLabel(localizer.getMessage("lblTeam") + ":"), "w 40px, h 30px");
populateTeamsComboBoxes();
// Set these before action listeners are added

View File

@@ -15,6 +15,7 @@ import forge.toolbox.FLabel;
import forge.toolbox.FScrollPane;
import forge.toolbox.FSkin;
import forge.toolbox.FSkin.SkinImage;
import forge.util.Localizer;
import forge.view.FDialog;
@SuppressWarnings("serial")
@@ -23,7 +24,9 @@ public class AvatarSelector extends FDialog {
private final Map<Integer, SkinImage> avatarMap = FSkin.getAvatars();
public AvatarSelector(final String playerName, final int currentIndex, final Collection<Integer> usedIndices) {
this.setTitle("Select avatar for " + playerName);
final Localizer localizer = Localizer.getInstance();
String s = localizer.getMessage("lblSelectAvatarFor");
this.setTitle(s.replace("%s",playerName));
final JPanel pnlAvatarPics = new JPanel(new WrapLayout());

View File

@@ -4,6 +4,7 @@ import forge.menus.MenuUtil;
import forge.model.FModel;
import forge.properties.ForgePreferences;
import forge.properties.ForgePreferences.FPref;
import forge.util.Localizer;
import javax.swing.*;
@@ -21,7 +22,8 @@ public final class ConstructedGameMenu {
private static ForgePreferences prefs = FModel.getPreferences();
public static JMenu getMenu() {
JMenu menu = new JMenu("Game");
final Localizer localizer = Localizer.getInstance();
JMenu menu = new JMenu(localizer.getMessage("lblGame"));
menu.setMnemonic(KeyEvent.VK_G);
menu.add(getMenuItem_SingletonMode());
menu.add(getMenuItem_ArtifactsMode());
@@ -30,8 +32,9 @@ public final class ConstructedGameMenu {
}
private static JMenuItem getMenuItem_SmallCreaturesMode() {
JCheckBoxMenuItem menu = new JCheckBoxMenuItem("Remove Small Creatures");
MenuUtil.setMenuHint(menu, "Remove 1/1 and 0/X creatures in generated decks.");
final Localizer localizer = Localizer.getInstance();
JCheckBoxMenuItem menu = new JCheckBoxMenuItem(localizer.getMessage("cbRemoveSmall"));
MenuUtil.setMenuHint(menu, localizer.getMessage("lblRemoveSmallCreatures"));
menu.setState(prefs.getPrefBoolean(FPref.DECKGEN_NOSMALL));
menu.addActionListener(new ActionListener() {
@Override
@@ -51,8 +54,9 @@ public final class ConstructedGameMenu {
}
private static JMenuItem getMenuItem_ArtifactsMode() {
JCheckBoxMenuItem menu = new JCheckBoxMenuItem("Remove Artifacts");
MenuUtil.setMenuHint(menu, "Remove artifact cards in generated decks.");
final Localizer localizer = Localizer.getInstance();
JCheckBoxMenuItem menu = new JCheckBoxMenuItem(localizer.getMessage("cbRemoveArtifacts"));
MenuUtil.setMenuHint(menu, localizer.getMessage("lblRemoveArtifacts"));
menu.setState(prefs.getPrefBoolean(FPref.DECKGEN_ARTIFACTS));
menu.addActionListener(new ActionListener() {
@Override
@@ -73,8 +77,9 @@ public final class ConstructedGameMenu {
}
private static JMenuItem getMenuItem_SingletonMode() {
JCheckBoxMenuItem menu = new JCheckBoxMenuItem("Singleton Mode");
MenuUtil.setMenuHint(menu, "Prevent non-land duplicates in generated decks.");
final Localizer localizer = Localizer.getInstance();
JCheckBoxMenuItem menu = new JCheckBoxMenuItem(localizer.getMessage("cbSingletons"));
MenuUtil.setMenuHint(menu, localizer.getMessage("PreventNonLandDuplicates"));
menu.setState(prefs.getPrefBoolean(FPref.DECKGEN_SINGLETONS));
menu.addActionListener(new ActionListener() {
@Override

View File

@@ -431,7 +431,7 @@ public enum CSubmenuPreferences implements ICDoc {
private void setPlayerNameButtonText() {
final FLabel btn = view.getBtnPlayerName();
final String name = prefs.getPref(FPref.PLAYER_NAME);
btn.setText(StringUtils.isBlank(name) ? "Human" : name);
btn.setText(StringUtils.isBlank(name) ? localizer.getMessage("lblHuman") : name);
}
@SuppressWarnings("serial")

View File

@@ -37,6 +37,8 @@ import forge.toolbox.FSkin;
import forge.toolbox.FSkin.SkinColor;
import forge.toolbox.FSkin.SkinnedLabel;
import forge.util.ReflectionUtil;
import forge.util.Localizer;
@SuppressWarnings("serial")
public class FNavigationBar extends FTitleBarBase {
@@ -71,15 +73,16 @@ public class FNavigationBar extends FTitleBarBase {
}
public void updateBtnCloseTooltip() {
final Localizer localizer = Localizer.getInstance();
switch (Singletons.getControl().getCloseAction()) {
case NONE:
btnClose.setToolTipText("Close");
btnClose.setToolTipText(localizer.getMessage("lblClose"));
break;
case CLOSE_SCREEN:
btnClose.setToolTipText(this.selectedTab.screen.getCloseButtonTooltip());
break;
case EXIT_FORGE:
btnClose.setToolTipText("Exit Forge");
btnClose.setToolTipText(localizer.getMessage("lblExitForge"));
break;
}
}