Index: binaries/data/mods/public/gui/session/chat/ChatMessageFormatSimulation.js =================================================================== --- binaries/data/mods/public/gui/session/chat/ChatMessageFormatSimulation.js +++ binaries/data/mods/public/gui/session/chat/ChatMessageFormatSimulation.js @@ -118,13 +118,33 @@ "player": colorizePlayernameByID(msg.players[0]) }); - let mPlayers = msg.players.map(playerID => colorizePlayernameByID(playerID)); - let lastPlayer = mPlayers.pop(); + let players = msg.players.map(playerID => colorizePlayernameByID(playerID)); + let playerCount = msg.players.length; + if (playerCount == 1) { + let playerList = players[0]; + } else if (playerCount == 2) { + let playerList = sprintf( + translate("%(firstPlayer) and %(lastPlayer)"), + { + "firstPlayer": players[0], + "lastPlayer": players[1] + } + ); + } else { + let lastPlayer = players.pop(); + // Translation: This comma is used for separating first to penultimate elements in an enumeration. + let firstPlayers = players.join(translate(", ")); + let playerList = sprintf( + translate("%(firstPlayers), and %(lastPlayer)"), + { + "firstPlayers": firstPlayers, + "lastPlayer": lastPlayer + } + ); + } return sprintf(translatePlural(msg.message.message, msg.message.pluralMessage, msg.message.pluralCount), { - // Translation: This comma is used for separating first to penultimate elements in an enumeration. - "players": mPlayers.join(translate(", ")), - "lastPlayer": lastPlayer + "players": playerList }); } }; Index: binaries/data/mods/public/simulation/components/EndGameManager.js =================================================================== --- binaries/data/mods/public/simulation/components/EndGameManager.js +++ binaries/data/mods/public/simulation/components/EndGameManager.js @@ -51,8 +51,8 @@ * @param {number} playerID - The player that should win. * @param {function} victoryReason - Function that maps from number to plural string, for example * n => markForPluralTranslation( - * "%(lastPlayer)s has won (game mode).", - * "%(players)s and %(lastPlayer)s have won (game mode).", + * "%(players)s has won (game mode).", + * "%(players)s have won (game mode).", * n)); */ EndGameManager.prototype.MarkPlayerAndAlliesAsWon = function(playerID, victoryString, defeatString) @@ -78,8 +78,8 @@ * @param {array} winningPlayers - The players that should win. * @param {function} victoryReason - Function that maps from number to plural string, for example * n => markForPluralTranslation( - * "%(lastPlayer)s has won (game mode).", - * "%(players)s and %(lastPlayer)s have won (game mode).", + * "%(players)s has won (game mode).", + * "%(players)s have won (game mode).", * n)); */ EndGameManager.prototype.MarkPlayersAsWon = function(winningPlayers, victoryString, defeatString) @@ -169,9 +169,10 @@ "players": [allies[0]], "allies" : allies, "message": markForPluralTranslation( - "%(lastPlayer)s has won (last player alive).", - "%(players)s and %(lastPlayer)s have won (last players alive).", - allies.length) + "%(players)s has won (last player alive).", + "%(players)s have won (last players alive).", + allies.length + ) }); } else