Translate "x didn't move"

pull/9761/head
Benedikt Werner 2021-09-09 05:10:43 +02:00
parent 0f77e19106
commit 51b72ae481
No known key found for this signature in database
GPG Key ID: 1DBFF0F8E9E121EB
6 changed files with 13 additions and 3 deletions

View File

@ -193,8 +193,10 @@ trait GameHelper { self: I18nHelper with UserHelper with AiHelper with StringHel
case (Black, None) => trans.blackTimeOut.txt() + " • " + trans.draw.txt()
}
case S.NoStart =>
val color = game.loser.fold(Color.white)(_.color).name.capitalize
s"$color didn't move"
game.loser match {
case Some(p) if p.color.white => trans.whiteDidntMove.txt()
case _ => trans.blackDidntMove.txt()
}
case S.Cheat => trans.cheatDetected.txt()
case S.VariantEnd =>
game.variant match {

View File

@ -21,6 +21,8 @@ object jsI18n {
trans.checkmate,
trans.whiteResigned,
trans.blackResigned,
trans.whiteDidntMove,
trans.blackDidntMove,
trans.stalemate,
trans.whiteLeftTheGame,
trans.blackLeftTheGame,

View File

@ -73,6 +73,8 @@ object jsI18n {
trans.checkmate,
trans.whiteResigned,
trans.blackResigned,
trans.whiteDidntMove,
trans.blackDidntMove,
trans.stalemate,
trans.whiteLeftTheGame,
trans.blackLeftTheGame,

View File

@ -49,6 +49,8 @@ val `whiteResigned` = new I18nKey("whiteResigned")
val `blackResigned` = new I18nKey("blackResigned")
val `whiteLeftTheGame` = new I18nKey("whiteLeftTheGame")
val `blackLeftTheGame` = new I18nKey("blackLeftTheGame")
val `whiteDidntMove` = new I18nKey("whiteDidntMove")
val `blackDidntMove` = new I18nKey("blackDidntMove")
val `shareThisUrlToLetSpectatorsSeeTheGame` = new I18nKey("shareThisUrlToLetSpectatorsSeeTheGame")
val `theComputerAnalysisHasFailed` = new I18nKey("theComputerAnalysisHasFailed")
val `viewTheComputerAnalysis` = new I18nKey("viewTheComputerAnalysis")

View File

@ -49,6 +49,8 @@
<string name="blackResigned">Black resigned</string>
<string name="whiteLeftTheGame">White left the game</string>
<string name="blackLeftTheGame">Black left the game</string>
<string name="whiteDidntMove">White didn't move</string>
<string name="blackDidntMove">Black didn't move</string>
<string name="shareThisUrlToLetSpectatorsSeeTheGame">Share this URL to let spectators see the game</string>
<string name="theComputerAnalysisHasFailed">The computer analysis has failed</string>
<string name="viewTheComputerAnalysis">View the computer analysis</string>

View File

@ -69,7 +69,7 @@ export default function status(ctrl: Ctrl): string {
d.game.winner ? '' : `${noarg('draw')}`
}`;
case 'noStart':
return (d.game.winner == 'white' ? 'Black' : 'White') + " didn't move";
return d.game.winner == 'white' ? noarg('blackDidntMove') : noarg('whiteDidntMove');
case 'cheat':
return noarg('cheatDetected');
case 'variantEnd':