translate round expiration countdown

This commit is contained in:
Niklas Fiekas 2017-12-30 16:50:41 +01:00
parent 27c2bcc278
commit e8eba0eda4
4 changed files with 8 additions and 7 deletions

View file

@ -53,7 +53,7 @@ trans.oneDay,
trans.nbDays,
trans.nbHours
), i18nJsObject(
trans.xSecondsToPlayTheFirstMove
trans.nbSecondsToPlayTheFirstMove
)) ++ g.variant.exotic.fold(i18nJsObject(
trans.kingInTheCenter,
trans.threeChecks,

View file

@ -648,7 +648,6 @@ val `custom` = new Translated("custom", Site)
val `notifications` = new Translated("notifications", Site)
val `challenges` = new Translated("challenges", Site)
val `perfRatingX` = new Translated("perfRatingX", Site)
val `xSecondsToPlayTheFirstMove` = new Translated("xSecondsToPlayTheFirstMove", Site)
val `practiceWithComputer` = new Translated("practiceWithComputer", Site)
val `anotherWasX` = new Translated("anotherWasX", Site)
val `bestWasX` = new Translated("bestWasX", Site)
@ -724,6 +723,7 @@ val `blocks` = new Translated("blocks", Site)
val `nbForumPosts` = new Translated("nbForumPosts", Site)
val `nbPerfTypePlayersThisWeek` = new Translated("nbPerfTypePlayersThisWeek", Site)
val `availableInNbLanguages` = new Translated("availableInNbLanguages", Site)
val `nbSecondsToPlayTheFirstMove` = new Translated("nbSecondsToPlayTheFirstMove", Site)
val `nbSeconds` = new Translated("nbSeconds", Site)
object arena {

View file

@ -770,7 +770,10 @@ in %3$s</string>
<string name="notifications">Notifications</string>
<string name="challenges">Challenges</string>
<string name="perfRatingX">Rating: %s</string>
<string name="xSecondsToPlayTheFirstMove">%s seconds to play the first move</string>
<plurals name="nbSecondsToPlayTheFirstMove">
<item quantity="one">%s second to play the first move</item>
<item quantity="other">%s seconds to play the first move</item>
</plurals>
<string name="practiceWithComputer">Practice with computer</string>
<string name="anotherWasX">Another was %s</string>
<string name="bestWasX">Best was %s</string>

View file

@ -9,6 +9,7 @@ export default function(ctrl: RoundController): [VNode, boolean] | undefined {
const d = ctrl.data.expiration;
if (!d) return;
const timeLeft = Math.max(0, d.movedAt - Date.now() + d.millisToMove),
secondsLeft = Math.floor(timeLeft / 1000),
myTurn = game.isPlayerTurn(ctrl.data),
emerg = myTurn && timeLeft < 8000;
if (!rang && emerg) {
@ -18,10 +19,7 @@ export default function(ctrl: RoundController): [VNode, boolean] | undefined {
return [
h('div.expiration.suggestion', {
class: { emerg }
}, [
h('strong', '' + Math.floor(timeLeft / 1000)),
'seconds to play the first move'
]),
}, ctrl.trans.vdomPlural('nbSecondsToPlayTheFirstMove', secondsLeft, h('strong', '' + secondsLeft))),
myTurn
];
}