mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
translate some text
This commit is contained in:
@@ -20,6 +20,7 @@ import forge.quest.QuestEventDuel;
|
||||
import forge.quest.QuestEventDuelManager;
|
||||
import forge.quest.QuestWorld;
|
||||
import forge.util.Aggregates;
|
||||
import forge.util.Localizer;
|
||||
|
||||
public class ConquestChaosBattle extends ConquestBattle {
|
||||
private final QuestWorld world;
|
||||
@@ -122,20 +123,20 @@ public class ConquestChaosBattle extends ConquestBattle {
|
||||
if (game.isMatchOver()) {
|
||||
view.getBtnContinue().setVisible(false);
|
||||
if (game.isMatchWonBy(humanPlayer)) {
|
||||
view.getBtnQuit().setText("Great!");
|
||||
view.getBtnQuit().setText(Localizer.getInstance().getMessage("lblGreat") + "!");
|
||||
model.getChaosBattleRecord().addWin();
|
||||
setConquered(true);
|
||||
}
|
||||
else {
|
||||
view.getBtnQuit().setText("OK");
|
||||
view.getBtnQuit().setText(Localizer.getInstance().getMessage("lblOK"));
|
||||
model.getChaosBattleRecord().addLoss();
|
||||
}
|
||||
model.saveData();
|
||||
}
|
||||
else {
|
||||
view.getBtnContinue().setVisible(true);
|
||||
view.getBtnContinue().setText("Continue");
|
||||
view.getBtnQuit().setText("Quit");
|
||||
view.getBtnContinue().setText(Localizer.getInstance().getMessage("btnContinue"));
|
||||
view.getBtnQuit().setText(Localizer.getInstance().getMessage("btnQuit"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ import forge.util.FileUtil;
|
||||
import forge.util.XmlReader;
|
||||
import forge.util.XmlWriter;
|
||||
import forge.util.gui.SOptionPane;
|
||||
import forge.util.Localizer;
|
||||
import forge.util.CardTranslation;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
@@ -265,15 +267,15 @@ public final class ConquestData {
|
||||
int count = cards.size();
|
||||
if (count == 0) { return false; }
|
||||
|
||||
String title = count == 1 ? "Exile Card" : "Exile " + count + " Cards";
|
||||
String cardStr = (count == 1 ? "card" : "cards");
|
||||
String title = count == 1 ? Localizer.getInstance().getMessage("lblExileCard") : Localizer.getInstance().getMessage("lblExileNCard", String.valueOf(count));
|
||||
String cardStr = (count == 1 ? Localizer.getInstance().getMessage("lblCard") : Localizer.getInstance().getMessage("lblCards"));
|
||||
|
||||
List<ConquestCommander> commandersBeingExiled = null;
|
||||
|
||||
StringBuilder message = new StringBuilder("Exile the following " + cardStr + " to receive {AE}" + value + "?\n");
|
||||
StringBuilder message = new StringBuilder(Localizer.getInstance().getMessage("lblExileFollowCardsToReceiveNAE", cardStr, "{AE}", String.valueOf(value)));
|
||||
for (PaperCard card : cards) {
|
||||
if (planeswalker == card) {
|
||||
SOptionPane.showMessageDialog("Current planeswalker cannot be exiled.", title, SOptionPane.INFORMATION_ICON);
|
||||
SOptionPane.showMessageDialog(Localizer.getInstance().getMessage("lblCurrentPlaneswalkerCannotBeExiled"), title, SOptionPane.INFORMATION_ICON);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -281,7 +283,7 @@ public final class ConquestData {
|
||||
for (ConquestCommander commander : commanders) {
|
||||
if (commander.getCard() == card) {
|
||||
if (!commander.getDeck().getMain().isEmpty()) {
|
||||
SOptionPane.showMessageDialog("Cannot exile a commander with a defined deck.", title, SOptionPane.INFORMATION_ICON);
|
||||
SOptionPane.showMessageDialog(Localizer.getInstance().getMessage("lblCannotCommanderWithDefinedDeck"), title, SOptionPane.INFORMATION_ICON);
|
||||
return false;
|
||||
}
|
||||
if (commandersBeingExiled == null) {
|
||||
@@ -290,19 +292,19 @@ public final class ConquestData {
|
||||
commandersBeingExiled.add(commander); //cache commander to make it easier to remove later
|
||||
}
|
||||
if (commander.getDeck().getMain().contains(card)) {
|
||||
commandersUsingCard.append("\n").append(commander.getName());
|
||||
commandersUsingCard.append("\n").append(CardTranslation.getTranslatedName(commander.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
if (commandersUsingCard.length() > 0) {
|
||||
SOptionPane.showMessageDialog(card.getName() + " is in use by the following commanders and cannot be exiled:\n" + commandersUsingCard, title, SOptionPane.INFORMATION_ICON);
|
||||
SOptionPane.showMessageDialog(Localizer.getInstance().getMessage("lblCommandersCardCannotBeExiledByCard", CardTranslation.getTranslatedName(card.getName()), commandersUsingCard), title, SOptionPane.INFORMATION_ICON);
|
||||
return false;
|
||||
}
|
||||
|
||||
message.append("\n").append(card.getName());
|
||||
message.append("\n").append(CardTranslation.getTranslatedName(card.getName()));
|
||||
}
|
||||
|
||||
if (SOptionPane.showConfirmDialog(message.toString(), title, "OK", "Cancel")) {
|
||||
if (SOptionPane.showConfirmDialog(message.toString(), title, Localizer.getInstance().getMessage("lblOK"), Localizer.getInstance().getMessage("lblCancel"))) {
|
||||
if (exiledCards.addAll(cards)) {
|
||||
if (commandersBeingExiled != null) {
|
||||
commanders.removeAll(commandersBeingExiled);
|
||||
@@ -319,18 +321,18 @@ public final class ConquestData {
|
||||
int count = cards.size();
|
||||
if (count == 0) { return false; }
|
||||
|
||||
String title = count == 1 ? "Retrieve Card" : "Retrieve " + count + " Cards";
|
||||
String cardStr = (count == 1 ? "card" : "cards");
|
||||
String title = count == 1 ? Localizer.getInstance().getMessage("lblRetrieveCard") : Localizer.getInstance().getMessage("lblRetrieveNCard", String.valueOf(count));
|
||||
String cardStr = (count == 1 ? Localizer.getInstance().getMessage("lblCard") : Localizer.getInstance().getMessage("lblCards"));
|
||||
if (aetherShards < cost) {
|
||||
SOptionPane.showMessageDialog("Not enough shards to retrieve " + cardStr + ".", title, SOptionPane.INFORMATION_ICON);
|
||||
SOptionPane.showMessageDialog(Localizer.getInstance().getMessage("lblNotEnoughShardsToRetrieveCards", cardStr), title, SOptionPane.INFORMATION_ICON);
|
||||
return false;
|
||||
}
|
||||
|
||||
StringBuilder message = new StringBuilder("Spend {AE}" + cost + " to retrieve the following " + cardStr + " from exile?\n");
|
||||
StringBuilder message = new StringBuilder(Localizer.getInstance().getMessage("lblSpendAECostToRetrieveCardsFromExile", "{AE}", String.valueOf(cost), cardStr));
|
||||
for (PaperCard card : cards) {
|
||||
message.append("\n").append(card.getName());
|
||||
}
|
||||
if (SOptionPane.showConfirmDialog(message.toString(), title, "OK", "Cancel")) {
|
||||
if (SOptionPane.showConfirmDialog(message.toString(), title, Localizer.getInstance().getMessage("lblOK"), Localizer.getInstance().getMessage("lblCancel"))) {
|
||||
if (exiledCards.removeAll(cards)) {
|
||||
for (PaperCard card : cards) {
|
||||
if (card.getRules().canBeCommander()) { //add back commander for card if needed
|
||||
@@ -492,14 +494,14 @@ public final class ConquestData {
|
||||
commanderCount = commanders.size();
|
||||
}
|
||||
|
||||
view.getLblAEtherShards().setText("Aether Shards: " + aetherShards);
|
||||
view.getLblPlaneswalkEmblems().setText("Planeswalk Emblems: " + planeswalkEmblems);
|
||||
view.getLblTotalWins().setText("Total Wins: " + wins);
|
||||
view.getLblTotalLosses().setText("Total Losses: " + losses);
|
||||
view.getLblConqueredEvents().setText("Conquered Events: " + formatRatio(conqueredCount, totalEventCount));
|
||||
view.getLblUnlockedCards().setText("Unlocked Cards: " + formatRatio(unlockedCardCount, totalCardCount));
|
||||
view.getLblCommanders().setText("Commanders: " + formatRatio(commanderCount, totalCommanderCount));
|
||||
view.getLblPlaneswalkers().setText("Planeswalkers: " + formatRatio(planeswalkerCount, totalPlaneswalkerCount));
|
||||
view.getLblAEtherShards().setText(Localizer.getInstance().getMessage("lblAetherShards") + ": " + aetherShards);
|
||||
view.getLblPlaneswalkEmblems().setText(Localizer.getInstance().getMessage("lblPlaneswalkEmblems") + ": " + planeswalkEmblems);
|
||||
view.getLblTotalWins().setText(Localizer.getInstance().getMessage("lblTotalWins") + ": " + wins);
|
||||
view.getLblTotalLosses().setText(Localizer.getInstance().getMessage("lblTotalLosses") + ": " + losses);
|
||||
view.getLblConqueredEvents().setText(Localizer.getInstance().getMessage("lblConqueredEvents") + ": " + formatRatio(conqueredCount, totalEventCount));
|
||||
view.getLblUnlockedCards().setText(Localizer.getInstance().getMessage("lblUnlockedCards") + ": " + formatRatio(unlockedCardCount, totalCardCount));
|
||||
view.getLblCommanders().setText(Localizer.getInstance().getMessage("lblCommanders") + ": " + formatRatio(commanderCount, totalCommanderCount));
|
||||
view.getLblPlaneswalkers().setText(Localizer.getInstance().getMessage("lblPlaneswalkers") + ": " + formatRatio(planeswalkerCount, totalPlaneswalkerCount));
|
||||
}
|
||||
|
||||
private String formatRatio(int numerator, int denominator) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import forge.quest.data.QuestPreferences.DifficultyPrefs;
|
||||
import forge.quest.data.QuestPreferences.QPref;
|
||||
import forge.util.MyRandom;
|
||||
import forge.util.TextUtil;
|
||||
import forge.util.Localizer;
|
||||
import forge.util.gui.SGuiChoose;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
@@ -72,15 +73,15 @@ public class QuestWinLoseController {
|
||||
|
||||
final boolean matchIsNotOver = !lastGame.isMatchOver();
|
||||
if (matchIsNotOver) {
|
||||
view.getBtnQuit().setText("Quit (-15 Credits)");
|
||||
view.getBtnQuit().setText(Localizer.getInstance().getMessage("lblQuitByPayCredits"));
|
||||
}
|
||||
else {
|
||||
view.getBtnContinue().setVisible(false);
|
||||
if (wonMatch) {
|
||||
view.getBtnQuit().setText("Great!");
|
||||
view.getBtnQuit().setText(Localizer.getInstance().getMessage("lblGreat") + "!");
|
||||
}
|
||||
else {
|
||||
view.getBtnQuit().setText("OK");
|
||||
view.getBtnQuit().setText(Localizer.getInstance().getMessage("lblOK"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,10 +161,10 @@ public class QuestWinLoseController {
|
||||
private void anteReport(final List<PaperCard> cardsWon, final List<PaperCard> cardsLost) {
|
||||
// Generate Swing components and attach.
|
||||
if (cardsWon != null && !cardsWon.isEmpty()) {
|
||||
view.showCards("Spoils! Cards won from ante", cardsWon);
|
||||
view.showCards(Localizer.getInstance().getMessage("lblSpoilsWonAnteCard"), cardsWon);
|
||||
}
|
||||
if (cardsLost != null && !cardsLost.isEmpty()) {
|
||||
view.showCards("Looted! Cards lost to ante", cardsLost);
|
||||
view.showCards(Localizer.getInstance().getMessage("lblLootedLostAnteCard"), cardsLost);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,7 +386,7 @@ public class QuestWinLoseController {
|
||||
sb.append(TextUtil.concatWithSpace(String.valueOf(credTotal), "credits in total."));
|
||||
qData.getAssets().addCredits(credTotal);
|
||||
|
||||
view.showMessage(sb.toString(), "Gameplay Results", FSkinProp.ICO_QUEST_GOLD);
|
||||
view.showMessage(sb.toString(), Localizer.getInstance().getMessage("lblGameplayResults"), FSkinProp.ICO_QUEST_GOLD);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -468,12 +469,12 @@ public class QuestWinLoseController {
|
||||
}
|
||||
|
||||
if (addDraftToken) {
|
||||
view.showMessage("For achieving a 25 win streak, you have been awarded a draft token!\nUse these tokens to generate new tournaments.", "Bonus Draft Token Reward", FSkinProp.ICO_QUEST_COIN);
|
||||
view.showMessage(Localizer.getInstance().getMessage("lblAchieving25WinStreakAwarded"), Localizer.getInstance().getMessage("lblBonusDraftTokenReward"), FSkinProp.ICO_QUEST_COIN);
|
||||
qData.getAchievements().addDraftToken();
|
||||
}
|
||||
|
||||
if (!cardsWon.isEmpty()) {
|
||||
view.showCards("You have achieved a " + (currentStreak == 0 ? "50" : currentStreak) + " win streak and won " + cardsWon.size() + " " + typeWon + " card" + ((cardsWon.size() != 1) ? "s" : "") + "!", cardsWon);
|
||||
view.showCards(Localizer.getInstance().getMessage("lblAchievedNWinStreakWinMCards", (currentStreak == 0 ? "50" : String.valueOf(currentStreak)), String.valueOf(cardsWon.size()), typeWon), cardsWon);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,7 +487,7 @@ public class QuestWinLoseController {
|
||||
*/
|
||||
private void awardJackpot() {
|
||||
final List<PaperCard> cardsWon = qData.getCards().addRandomRare(10);
|
||||
view.showCards("You just won 10 random rares!", cardsWon);
|
||||
view.showCards(Localizer.getInstance().getMessage("lblJustWonTenRandomRares"), cardsWon);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -515,13 +516,13 @@ public class QuestWinLoseController {
|
||||
|
||||
Collections.sort(formats);
|
||||
|
||||
final GameFormat selected = SGuiChoose.getChoices("Choose bonus booster format", 1, 1, formats, pref, null).get(0);
|
||||
final GameFormat selected = SGuiChoose.getChoices(Localizer.getInstance().getMessage("lblChooseBonusBoosterFormat"), 1, 1, formats, pref, null).get(0);
|
||||
FModel.getQuestPreferences().setPref(QPref.BOOSTER_FORMAT, selected.toString());
|
||||
|
||||
cardsWon = qData.getCards().generateQuestBooster(selected.getFilterPrinted());
|
||||
qData.getCards().addAllCards(cardsWon);
|
||||
|
||||
title = "Bonus booster pack from the \"" + selected.getName() + "\" format!";
|
||||
title = Localizer.getInstance().getMessage("lblBonusFormatBoosterPack", selected.getName());
|
||||
|
||||
} else {
|
||||
|
||||
@@ -566,7 +567,7 @@ public class QuestWinLoseController {
|
||||
maxChoices--;
|
||||
}
|
||||
|
||||
final CardEdition chooseEd = SGuiChoose.one("Choose bonus booster set", options);
|
||||
final CardEdition chooseEd = SGuiChoose.one(Localizer.getInstance().getMessage("lblChooseBonusBoosterSet"), options);
|
||||
|
||||
if (customBooster) {
|
||||
List<PaperCard> cards = FModel.getMagicDb().getCommonCards().getAllCards(Predicates.printedInSet(chooseEd.getCode()));
|
||||
@@ -578,7 +579,7 @@ public class QuestWinLoseController {
|
||||
}
|
||||
|
||||
qData.getCards().addAllCards(cardsWon);
|
||||
title = "Bonus " + chooseEd.getName() + " Booster Pack!";
|
||||
title = Localizer.getInstance().getMessage("lblBonusSetBoosterPack", chooseEd.getName());
|
||||
|
||||
}
|
||||
|
||||
@@ -606,18 +607,14 @@ public class QuestWinLoseController {
|
||||
private void awardChallengeWin() {
|
||||
final long questRewardCredits = ((QuestEventChallenge) qEvent).getCreditsReward();
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("Challenge completed.\n\n");
|
||||
sb.append("Challenge bounty: ").append(questRewardCredits).append(" credits.");
|
||||
|
||||
String winMessage = ((QuestEventChallenge)qEvent).getWinMessage();
|
||||
if (!winMessage.isEmpty()) {
|
||||
view.showMessage(winMessage.replace("\\n", "\n"), "Congratulations", FSkinProp.ICO_QUEST_NOTES);
|
||||
view.showMessage(winMessage.replace("\\n", "\n"), Localizer.getInstance().getMessage("lblCongratulations"), FSkinProp.ICO_QUEST_NOTES);
|
||||
}
|
||||
|
||||
qData.getAssets().addCredits(questRewardCredits);
|
||||
|
||||
view.showMessage(sb.toString(), "Challenge Rewards for \"" + qEvent.getTitle() + "\"", FSkinProp.ICO_QUEST_BOX);
|
||||
view.showMessage(Localizer.getInstance().getMessage("lblChallengeCompletedBountyIS", String.valueOf(questRewardCredits)), Localizer.getInstance().getMessage("lblChallengeRewardsForEvent", qEvent.getTitle()), FSkinProp.ICO_QUEST_BOX);
|
||||
|
||||
awardSpecialReward(null);
|
||||
}
|
||||
@@ -676,7 +673,7 @@ public class QuestWinLoseController {
|
||||
|
||||
private void penalizeLoss() {
|
||||
final int x = FModel.getQuestPreferences().getPrefInt(QPref.PENALTY_LOSS);
|
||||
view.showMessage("You lose! You have lost " + x + " credits.", "Gameplay Results", FSkinProp.ICO_QUEST_HEART);
|
||||
view.showMessage(Localizer.getInstance().getMessage("lblYouHaveLostNCredits", String.valueOf(x)), Localizer.getInstance().getMessage("lblGameplayResults"), FSkinProp.ICO_QUEST_HEART);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;
|
||||
|
||||
import forge.GuiBase;
|
||||
import forge.assets.FSkinProp;
|
||||
import forge.util.Localizer;
|
||||
|
||||
public class SOptionPane {
|
||||
public static final FSkinProp QUESTION_ICON = FSkinProp.ICO_QUESTION;
|
||||
@@ -30,7 +31,7 @@ public class SOptionPane {
|
||||
}
|
||||
|
||||
public static void showMessageDialog(final String message, final String title, final FSkinProp 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) {
|
||||
@@ -38,11 +39,11 @@ public class SOptionPane {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user