From cb0a4dab5b191c06416de5324ec564b7e5f39b2f Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 09:37:25 +0000 Subject: [PATCH] translated GameAction.java --- res/lang/de.properties | 22 ++++++++++++ res/lang/en.properties | 22 ++++++++++++ src/forge/GameAction.java | 48 ++++++++++++++------------ src/forge/properties/NewConstants.java | 28 +++++++++++++++ 4 files changed, 97 insertions(+), 23 deletions(-) diff --git a/res/lang/de.properties b/res/lang/de.properties index d69a0df924a..4a2511614a6 100644 --- a/res/lang/de.properties +++ b/res/lang/de.properties @@ -145,3 +145,25 @@ DownloadPrices/title=Preise Aktualisieren DownloadPrices/startupdate=Starte Update DownloadPrices/downloading=Downloade DownloadPrices/compiling=Compiling + +GameAction/heads=Kopf +GameAction/tails=Zahl +GameAction/heads_or_tails=Kopf oder Zahl? +GameAction/coin_toss=Münze werfen +GameAction/human_win=Spieler gewinnt das Münzewerfen +GameAction/computer_win=Computer gewinnt das Münzewerfen +GameAction/human_mana_cost=Human has no cards with a converted mana cost in library. +GameAction/computer_mana_cost=Computer has no cards with a converted mana cost in library. +GameAction/computer_starts=Spieler beginnt +GameAction/human_starts=Computer beginnt +GameAction/computer_cut=Computer cut his / her deck to : +GameAction/human_cut=Human cut his / her deck to : +GameAction/cut_number=Number of times the deck has been cut: +GameAction/resolve_starter=Can't resolve starter by cut: Reverting to Coin Toss\r\n +GameAction/equal_converted_mana=Equal Converted Mana Cost Cut +GameAction/cutting_again=Cutting Again..... +GameAction/yes=Ja +GameAction/no=Nein +GameAction/want_dredge=Do you want to dredge? +GameAction/select_dredge=Select card to dredge +GameAction/choose_2nd_land=Wähle zweites Land diff --git a/res/lang/en.properties b/res/lang/en.properties index 85ff21dff72..1a6c4ac706b 100644 --- a/res/lang/en.properties +++ b/res/lang/en.properties @@ -144,3 +144,25 @@ DownloadPrices/title=Update Prices DownloadPrices/startupdate=Start Update DownloadPrices/downloading=Downloading DownloadPrices/compiling=Compiling + +GameAction/heads=Heads +GameAction/tails=Tails +GameAction/heads_or_tails=Heads or Tails? +GameAction/coin_toss=Coin Toss to Start the Game +GameAction/human_win=Human Wins by Coin Toss +GameAction/computer_win=Computer Wins by Coin Toss +GameAction/human_mana_cost=Human has no cards with a converted mana cost in library. +GameAction/computer_mana_cost=Computer has no cards with a converted mana cost in library. +GameAction/computer_starts=Human Starts +GameAction/human_starts=Computer Starts +GameAction/computer_cut=Computer cut his / her deck to : +GameAction/human_cut=Human cut his / her deck to : +GameAction/cut_number=Number of times the deck has been cut: +GameAction/resolve_starter=Can't resolve starter by cut: Reverting to Coin Toss\r\n +GameAction/equal_converted_mana=Equal Converted Mana Cost Cut +GameAction/cutting_again=Cutting Again..... +GameAction/yes=Yes +GameAction/no=No +GameAction/want_dredge=Do you want to dredge? +GameAction/select_dredge=Select card to dredge +GameAction/choose_2nd_land=Choose second land diff --git a/src/forge/GameAction.java b/src/forge/GameAction.java index 974c2d8830a..843f30058f2 100644 --- a/src/forge/GameAction.java +++ b/src/forge/GameAction.java @@ -14,6 +14,8 @@ import javax.swing.JFrame; import javax.swing.JOptionPane; import com.esotericsoftware.minlog.Log; +import forge.properties.ForgeProps; +import forge.properties.NewConstants.LANG.GameAction.GAMEACTION_TEXT; public class GameAction { @@ -2374,10 +2376,10 @@ public class GameAction { //only allow dredge by the human for now //TODO - allow dredge by the computer (probably 50% of the time at random so compy doesn't mill itself if(player.isHuman() && 0 < getDredge().size()) { - String choices[] = {"Yes", "No"}; - Object o = AllZone.Display.getChoice("Do you want to dredge?", choices); + String choices[] = {ForgeProps.getLocalized(GAMEACTION_TEXT.YES), ForgeProps.getLocalized(GAMEACTION_TEXT.NO)}; + Object o = AllZone.Display.getChoice(ForgeProps.getLocalized(GAMEACTION_TEXT.WANT_DREDGE), choices); if(o.equals("Yes")) { - Card c = (Card) AllZone.Display.getChoice("Select card to dredge", getDredge().toArray()); + Card c = (Card) AllZone.Display.getChoice(ForgeProps.getLocalized(GAMEACTION_TEXT.SELECT_DREDGE), getDredge().toArray()); //might have to make this more sophisticated //dredge library, put card in hand @@ -2831,8 +2833,8 @@ public class GameAction { //decides who goes first when starting another game, used by newGame() public void seeWhoPlaysFirst_CoinToss() { - Object[] possibleValues = {"Heads", "Tails" }; - Object q = JOptionPane.showOptionDialog(null, "Heads or Tails?", "Coin Toss to Start the Game", + Object[] possibleValues = {ForgeProps.getLocalized(GAMEACTION_TEXT.HEADS), ForgeProps.getLocalized(GAMEACTION_TEXT.TAILS)}; + Object q = JOptionPane.showOptionDialog(null, ForgeProps.getLocalized(GAMEACTION_TEXT.HEADS_OR_TAILS), ForgeProps.getLocalized(GAMEACTION_TEXT.COIN_TOSS), JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, possibleValues, possibleValues[0]); @@ -2841,19 +2843,19 @@ public class GameAction { String Computer_Flip = " "; // JOptionPane.showMessageDialog(null, q, "", JOptionPane.INFORMATION_MESSAGE); if(q.equals(0)) { - Human_Flip = "Heads"; - Computer_Flip = "Tails"; + Human_Flip = ForgeProps.getLocalized(GAMEACTION_TEXT.HEADS); + Computer_Flip = ForgeProps.getLocalized(GAMEACTION_TEXT.TAILS); } else { - Human_Flip = "Tails"; - Computer_Flip = "Heads"; + Human_Flip = ForgeProps.getLocalized(GAMEACTION_TEXT.TAILS); + Computer_Flip = ForgeProps.getLocalized(GAMEACTION_TEXT.HEADS); } if((Flip == 0 && q.equals(0)) || (Flip == 1 && q.equals(1))) - JOptionPane.showMessageDialog(null, Human_Flip + "\r\n" + "Human Wins by Coin Toss", "", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(null, Human_Flip + "\r\n" + ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_WIN), "", JOptionPane.INFORMATION_MESSAGE); else { computerStartsGame(); - JOptionPane.showMessageDialog(null, Computer_Flip + "\r\n" + "Computer Wins by Coin Toss", "", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(null, Computer_Flip + "\r\n" + ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_WIN), "", JOptionPane.INFORMATION_MESSAGE); } }//seeWhoPlaysFirst_CoinToss() @@ -2885,14 +2887,14 @@ public class GameAction { HumanCut = HLibrary.get(MyRandom.random.nextInt(HLibrary.size())); else { computerStartsGame(); - JOptionPane.showMessageDialog(null, "Human has no cards with a converted mana cost in library." + "\r\n" + "Computer Starts", "", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(null, ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_MANA_COST) + "\r\n" + ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_STARTS), "", JOptionPane.INFORMATION_MESSAGE); return; } if(CLibrary.size() > 0) ComputerCut = CLibrary.get(MyRandom.random.nextInt(CLibrary.size())); else { - JOptionPane.showMessageDialog(null, "Computer has no cards with a converted mana cost in library." + "\r\n" + "Human Starts", "", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(null, ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_MANA_COST) + "\r\n" + ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_STARTS), "", JOptionPane.INFORMATION_MESSAGE); return; } @@ -2901,34 +2903,34 @@ public class GameAction { AllZone.GameAction.moveTo(AllZone.getZone(Constant.Zone.Library, AllZone.ComputerPlayer),AllZone.GameAction.ComputerCut); StringBuilder sb = new StringBuilder(); - sb.append("Human cut his / her deck to : " + HumanCut.getName() + " (" + HumanCut.getManaCost() + ")" + "\r\n"); - sb.append("Computer cut his / her deck to : " + ComputerCut.getName() + " (" + ComputerCut.getManaCost() + ")" + "\r\n"); + sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_CUT) + HumanCut.getName() + " (" + HumanCut.getManaCost() + ")" + "\r\n"); + sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_CUT) + ComputerCut.getName() + " (" + ComputerCut.getManaCost() + ")" + "\r\n"); sb.append("\r\n" + "Number of times the deck has been cut: " + Cut_Count + "\r\n"); if(CardUtil.getConvertedManaCost(ComputerCut.getManaCost()) > CardUtil.getConvertedManaCost(HumanCut.getManaCost())){ computerStartsGame(); - JOptionPane.showMessageDialog(null, sb + "Computer Starts", "", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_STARTS), "", JOptionPane.INFORMATION_MESSAGE); return; } else if(CardUtil.getConvertedManaCost(ComputerCut.getManaCost()) < CardUtil.getConvertedManaCost(HumanCut.getManaCost())) { - JOptionPane.showMessageDialog(null, sb + "Human Starts", "", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_STARTS), "", JOptionPane.INFORMATION_MESSAGE); return; } else{ - sb.append("Equal Converted Mana Cost Cut" + "\r\n"); + sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.EQUAL_CONVERTED_MANA) + "\r\n"); if (i == Cut_CountMax-1) { - sb.append("Can't resolve starter by cut: Reverting to Coin Toss\r\n"); + sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.RESOLVE_STARTER)); if(MyRandom.random.nextInt(2) == 1) - JOptionPane.showMessageDialog(null,sb + "Human Wins by Coin Toss", "", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(null,sb + ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_WIN), "", JOptionPane.INFORMATION_MESSAGE); else { computerStartsGame(); - JOptionPane.showMessageDialog(null,sb + "Computer Wins by Coin Toss", "", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(null,sb + ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_WIN), "", JOptionPane.INFORMATION_MESSAGE); } return; } else { - sb.append("Cutting Again....."); + sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.CUTTING_AGAIN)); } JOptionPane.showMessageDialog(null,sb, "", JOptionPane.INFORMATION_MESSAGE); } @@ -3663,7 +3665,7 @@ public class GameAction { }//if if ((list.size() == 0) || onlyOneLand) return; //branch 3 - o = AllZone.Display.getChoiceOptional("Choose second land", list.toArray()); + o = AllZone.Display.getChoiceOptional(ForgeProps.getLocalized(GAMEACTION_TEXT.CHOOSE_2ND_LAND), list.toArray()); if(o != null) { PlayerZone secondZone = AllZone.getZone(Zone2, AllZone.HumanPlayer); diff --git a/src/forge/properties/NewConstants.java b/src/forge/properties/NewConstants.java index 48f93416cac..b253defd9b5 100644 --- a/src/forge/properties/NewConstants.java +++ b/src/forge/properties/NewConstants.java @@ -336,6 +336,34 @@ public interface NewConstants { } } + public static interface GameAction { + public static interface GAMEACTION_TEXT { + public static final String HEADS ="%s/GameAction/heads"; + public static final String TAILS ="%s/GameAction/tails"; + public static final String HEADS_OR_TAILS ="%s/GameAction/heads_or_tails"; + public static final String COIN_TOSS ="%s/GameAction/coin_toss"; + public static final String HUMAN_WIN ="%s/GameAction/human_win"; + public static final String COMPUTER_WIN ="%s/GameAction/computer_win"; + public static final String COMPUTER_STARTS ="%s/GameAction/computer_starts"; + public static final String HUMAN_STARTS ="%s/GameAction/human_starts"; + public static final String HUMAN_MANA_COST ="%s/GameAction/human_mana_cost"; + public static final String COMPUTER_MANA_COST ="%s/GameAction/computer_mana_cost"; + public static final String COMPUTER_CUT ="%s/GameAction/computer_cut"; + public static final String HUMAN_CUT ="%s/GameAction/human_cut"; + public static final String CUT_NUMBER ="%s/GameAction/cut_number"; + public static final String RESOLVE_STARTER ="%s/GameAction/resolve_starter"; + public static final String EQUAL_CONVERTED_MANA ="%s/GameAction/equal_converted_mana"; + public static final String CUTTING_AGAIN ="%s/GameAction/cutting_again"; + public static final String YES ="%s/GameAction/yes"; + public static final String NO ="%s/GameAction/no"; + public static final String WANT_DREDGE ="%s/GameAction/want_dredge"; + public static final String SELECT_DREDGE ="%s/GameAction/select_dredge"; + public static final String CHOOSE_2ND_LAND ="%s/GameAction/choose_2nd_land"; + + + + } + } } }