Merge pull request #9251 from benediktwerner/trans-swiss
More swiss translations
This commit is contained in:
commit
778e8a667e
|
@ -5,6 +5,7 @@ import lila.app.templating.Environment._
|
||||||
import lila.app.ui.ScalatagsTemplate._
|
import lila.app.ui.ScalatagsTemplate._
|
||||||
import lila.i18n.{ I18nKeys => trans }
|
import lila.i18n.{ I18nKeys => trans }
|
||||||
import lila.swiss.Swiss
|
import lila.swiss.Swiss
|
||||||
|
import play.api.i18n.Lang
|
||||||
|
|
||||||
import controllers.routes
|
import controllers.routes
|
||||||
|
|
||||||
|
@ -70,17 +71,13 @@ object bits {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def showInterval(s: Swiss): Frag =
|
def showInterval(s: Swiss)(implicit lang: Lang): Frag =
|
||||||
s.settings.dailyInterval match {
|
s.settings.dailyInterval match {
|
||||||
case Some(1) => frag("One round per day")
|
case Some(d) => trans.swiss.oneRoundEveryXDays.pluralSame(d)
|
||||||
case Some(d) => frag(s"One round every $d days")
|
case None if s.settings.manualRounds => trans.swiss.roundsAreStartedManually()
|
||||||
case None if s.settings.manualRounds => frag("Rounds are started manually")
|
|
||||||
case None =>
|
case None =>
|
||||||
frag(
|
if (s.settings.intervalSeconds < 60) trans.swiss.xSecondsBetweenRounds.pluralSame(s.settings.intervalSeconds)
|
||||||
if (s.settings.intervalSeconds < 60) pluralize("second", s.settings.intervalSeconds)
|
else trans.swiss.xMinutesBetweenRounds.pluralSame(s.settings.intervalSeconds / 60)
|
||||||
else pluralize("minute", s.settings.intervalSeconds / 60),
|
|
||||||
" between rounds"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def jsI18n(implicit ctx: Context) = i18nJsObject(i18nKeys)
|
def jsI18n(implicit ctx: Context) = i18nJsObject(i18nKeys)
|
||||||
|
@ -102,6 +99,10 @@ object bits {
|
||||||
trans.averageOpponent,
|
trans.averageOpponent,
|
||||||
trans.tournamentComplete,
|
trans.tournamentComplete,
|
||||||
trans.password,
|
trans.password,
|
||||||
trans.swiss.viewAllXRounds
|
trans.swiss.viewAllXRounds,
|
||||||
|
trans.swiss.ongoingGames,
|
||||||
|
trans.swiss.startingIn,
|
||||||
|
trans.swiss.nextRound,
|
||||||
|
trans.team.joinTeam,
|
||||||
).map(_.key)
|
).map(_.key)
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,7 @@ object side {
|
||||||
if (s.settings.rated) trans.ratedTournament() else trans.casualTournament()
|
if (s.settings.rated) trans.ratedTournament() else trans.casualTournament()
|
||||||
),
|
),
|
||||||
p(
|
p(
|
||||||
span(cls := "swiss__meta__round")(s"${s.round}/${s.settings.nbRounds}"),
|
span(cls := "swiss__meta__round")(trans.swiss.nbRounds.plural(s.settings.nbRounds, s"${s.round}/${s.settings.nbRounds}")),
|
||||||
" rounds",
|
|
||||||
separator,
|
separator,
|
||||||
a(href := routes.Swiss.home)("Swiss"),
|
a(href := routes.Swiss.home)("Swiss"),
|
||||||
(isGranted(_.ManageTournament) || (ctx.userId.has(s.createdBy) && !s.isFinished)) option frag(
|
(isGranted(_.ManageTournament) || (ctx.userId.has(s.createdBy) && !s.isFinished)) option frag(
|
||||||
|
|
|
@ -1877,6 +1877,9 @@ val `lagCompensationExplanation` = new I18nKey("lag:lagCompensationExplanation")
|
||||||
|
|
||||||
object swiss {
|
object swiss {
|
||||||
val `swissTournaments` = new I18nKey("swiss:swissTournaments")
|
val `swissTournaments` = new I18nKey("swiss:swissTournaments")
|
||||||
|
val `roundsAreStartedManually` = new I18nKey("swiss:roundsAreStartedManually")
|
||||||
|
val `startingIn` = new I18nKey("swiss:startingIn")
|
||||||
|
val `nextRound` = new I18nKey("swiss:nextRound")
|
||||||
val `tournStartDate` = new I18nKey("swiss:tournStartDate")
|
val `tournStartDate` = new I18nKey("swiss:tournStartDate")
|
||||||
val `nbRounds` = new I18nKey("swiss:nbRounds")
|
val `nbRounds` = new I18nKey("swiss:nbRounds")
|
||||||
val `nbRoundsHelp` = new I18nKey("swiss:nbRoundsHelp")
|
val `nbRoundsHelp` = new I18nKey("swiss:nbRoundsHelp")
|
||||||
|
@ -1885,6 +1888,11 @@ val `forbiddenPairings` = new I18nKey("swiss:forbiddenPairings")
|
||||||
val `forbiddenPairingsHelp` = new I18nKey("swiss:forbiddenPairingsHelp")
|
val `forbiddenPairingsHelp` = new I18nKey("swiss:forbiddenPairingsHelp")
|
||||||
val `newSwiss` = new I18nKey("swiss:newSwiss")
|
val `newSwiss` = new I18nKey("swiss:newSwiss")
|
||||||
val `viewAllXRounds` = new I18nKey("swiss:viewAllXRounds")
|
val `viewAllXRounds` = new I18nKey("swiss:viewAllXRounds")
|
||||||
|
val `nbRounds` = new I18nKey("swiss:nbRounds")
|
||||||
|
val `oneRoundEveryXDays` = new I18nKey("swiss:oneRoundEveryXDays")
|
||||||
|
val `xSecondsBetweenRounds` = new I18nKey("swiss:xSecondsBetweenRounds")
|
||||||
|
val `xMinutesBetweenRounds` = new I18nKey("swiss:xMinutesBetweenRounds")
|
||||||
|
val `ongoingGames` = new I18nKey("swiss:ongoingGames")
|
||||||
}
|
}
|
||||||
|
|
||||||
object puzzle {
|
object puzzle {
|
||||||
|
|
|
@ -5,6 +5,28 @@
|
||||||
<item quantity="one">View the round</item>
|
<item quantity="one">View the round</item>
|
||||||
<item quantity="other">View all %s rounds</item>
|
<item quantity="other">View all %s rounds</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
|
<plurals name="nbRounds" comment="%s is currentRound/maxRounds e.g. 5/9 maxRounds is always at least 3">
|
||||||
|
<item quantity="other">%s rounds</item>
|
||||||
|
</plurals>
|
||||||
|
<plurals name="oneRoundEveryXDays">
|
||||||
|
<item quantity="one">One round per day</item>
|
||||||
|
<item quantity="other">One round every %s days</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="roundsAreStartedManually">Rounds are started manually</string>
|
||||||
|
<plurals name="xSecondsBetweenRounds">
|
||||||
|
<item quantity="one">%s second between rounds</item>
|
||||||
|
<item quantity="other">%s seconds between rounds</item>
|
||||||
|
</plurals>
|
||||||
|
<plurals name="xMinutesBetweenRounds">
|
||||||
|
<item quantity="one">%s minunte between rounds</item>
|
||||||
|
<item quantity="other">%s minutes between rounds</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="startingIn" comment="Displayed above a timer">Starting in</string>
|
||||||
|
<string name="nextRound">Next round</string>
|
||||||
|
<plurals name="ongoingGames" comment="Displayed next to the ongoing games count">
|
||||||
|
<item quantity="one">Ongoing game</item>
|
||||||
|
<item quantity="other">Ongoing games</item>
|
||||||
|
</plurals>
|
||||||
<string name="tournStartDate">Tournament start date</string>
|
<string name="tournStartDate">Tournament start date</string>
|
||||||
<string name="nbRounds">Number of rounds</string>
|
<string name="nbRounds">Number of rounds</string>
|
||||||
<string name="nbRoundsHelp">An odd number of rounds allows optimal color balance.</string>
|
<string name="nbRoundsHelp">An odd number of rounds allows optimal color balance.</string>
|
||||||
|
|
|
@ -27,7 +27,7 @@ function clock(ctrl: SwissCtrl): VNode | undefined {
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
return h(`div.clock.clock-created.time-cache-${next.at}`, [
|
return h(`div.clock.clock-created.time-cache-${next.at}`, [
|
||||||
h('span.shy', ctrl.data.status == 'created' ? 'Starting in' : 'Next round'),
|
h('span.shy', ctrl.data.status == 'created' ? ctrl.trans.noarg('startingIn') : ctrl.trans.noarg('nextRound')),
|
||||||
h('span.time.text', {
|
h('span.time.text', {
|
||||||
hook: startClock(next.in + 1),
|
hook: startClock(next.in + 1),
|
||||||
}),
|
}),
|
||||||
|
@ -36,7 +36,7 @@ function clock(ctrl: SwissCtrl): VNode | undefined {
|
||||||
|
|
||||||
function ongoing(ctrl: SwissCtrl): VNode | undefined {
|
function ongoing(ctrl: SwissCtrl): VNode | undefined {
|
||||||
const nb = ctrl.data.nbOngoing;
|
const nb = ctrl.data.nbOngoing;
|
||||||
return nb ? h('div.ongoing', [h('span.nb', [nb]), h('span.shy', 'Ongoing games')]) : undefined;
|
return nb ? h('div.ongoing', [h('span.nb', [nb]), h('span.shy', ctrl.trans.plural('ongoingGames', nb))]) : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function (ctrl: SwissCtrl): VNode {
|
export default function (ctrl: SwissCtrl): VNode {
|
||||||
|
|
|
@ -150,7 +150,7 @@ function joinButton(ctrl: SwissCtrl): VNode | undefined {
|
||||||
'data-icon': '',
|
'data-icon': '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'Join the team'
|
ctrl.trans.noarg('joinTeam')
|
||||||
);
|
);
|
||||||
|
|
||||||
if (d.canJoin)
|
if (d.canJoin)
|
||||||
|
|
Loading…
Reference in a new issue