Translated strings related to Win/Loose/Concede

This commit is contained in:
Peter
2019-09-30 11:25:27 +02:00
parent 116ab5da29
commit 17fabb0bec
9 changed files with 185 additions and 47 deletions

View File

@@ -234,6 +234,6 @@ public final class GameOutcome implements Iterable<Entry<RegisteredPlayer, Playe
}
public String getOutcomeString(RegisteredPlayer player) {
return playerNames.get(player) + " has " + playerRating.get(player).getOutcome();
return playerNames.get(player) + " " + playerRating.get(player).getOutcome();
}
}

View File

@@ -1,6 +1,8 @@
package forge.game.player;
import forge.util.Localizer;
/**
* TODO: Write javadoc for this type.
*/
@@ -58,23 +60,24 @@ public class PlayerOutcome {
*/
@Override
public String toString() {
Localizer localizer = Localizer.getInstance();
if ( lossState == null ) {
if ( altWinSourceName == null )
return "won because all opponents have lost";
return localizer.getMessage("lblWonBecauseAllOpponentsHaveLost");
else
return "won due to effect of '" + altWinSourceName + "'";
return localizer.getMessage("lblWonDueToEffectOf").replace("%s", altWinSourceName);
}
switch(lossState){
case Conceded: return "conceded";
case Milled: return "lost trying to draw cards from empty library";
case LifeReachedZero: return "lost because life total reached 0";
case Poisoned: return "lost because of obtaining 10 poison counters";
case OpponentWon: return "lost because an opponent has won by spell '" + loseConditionSpell + "'";
case SpellEffect: return "lost due to effect of spell '" + loseConditionSpell + "'";
case CommanderDamage: return "lost due to accumulation of 21 damage from generals";
case IntentionalDraw: return "accepted that the game is a draw";
case Conceded: return localizer.getMessage("lblConceded");
case Milled: return localizer.getMessage("lblLostTryingToDrawCardsFromEmptyLibrary");
case LifeReachedZero: return localizer.getMessage("lblLostBecauseLifeTotalReachedZero");
case Poisoned: return localizer.getMessage("lblLostBecauseOfObtainingTenPoisonCounters");
case OpponentWon: return localizer.getMessage("lblLostBecauseAnOpponentHasWonBySpell").replace("%s", loseConditionSpell);
case SpellEffect: return localizer.getMessage("lblLostDueToEffectOfSpell").replace("%s", loseConditionSpell);
case CommanderDamage: return localizer.getMessage("lblLostDueToAccumulationOf21DamageFromGenerals");
case IntentionalDraw: return localizer.getMessage("lblAcceptedThatTheGameIsADraw");
}
return "lost for unknown reason (this is a bug)";
return localizer.getMessage("lblLostForUnknownReasonBug");
}
}