Skip to content

Commit

Permalink
Merge pull request #16254 from SergioGlorias/relay-trans
Browse files Browse the repository at this point in the history
Some translations of the broadcast
  • Loading branch information
ornicar authored Oct 22, 2024
2 parents c730bc7 + b67f411 commit 9f0c8c6
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 64 deletions.
24 changes: 22 additions & 2 deletions modules/coreI18n/src/main/key.scala
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ object I18nKey:
val `created`: I18nKey = "arena:created"
val `recentlyPlayed`: I18nKey = "arena:recentlyPlayed"
val `bestResults`: I18nKey = "arena:bestResults"
val `stats`: I18nKey = "arena:stats"
val `tournamentStats`: I18nKey = "arena:tournamentStats"
val `rankAvgHelp`: I18nKey = "arena:rankAvgHelp"
val `medians`: I18nKey = "arena:medians"
Expand Down Expand Up @@ -154,7 +153,6 @@ object I18nKey:
val `sourceGameIds`: I18nKey = "broadcast:sourceGameIds"
val `startDateTimeZone`: I18nKey = "broadcast:startDateTimeZone"
val `startDateHelp`: I18nKey = "broadcast:startDateHelp"
val `credits`: I18nKey = "broadcast:credits"
val `currentGameUrl`: I18nKey = "broadcast:currentGameUrl"
val `downloadAllRounds`: I18nKey = "broadcast:downloadAllRounds"
val `resetRound`: I18nKey = "broadcast:resetRound"
Expand All @@ -175,6 +173,27 @@ object I18nKey:
val `ageThisYear`: I18nKey = "broadcast:ageThisYear"
val `unrated`: I18nKey = "broadcast:unrated"
val `recentTournaments`: I18nKey = "broadcast:recentTournaments"
val `openLichess`: I18nKey = "broadcast:openLichess"
val `teams`: I18nKey = "broadcast:teams"
val `boards`: I18nKey = "broadcast:boards"
val `overview`: I18nKey = "broadcast:overview"
val `subscribeTitle`: I18nKey = "broadcast:subscribeTitle"
val `uploadImage`: I18nKey = "broadcast:uploadImage"
val `noBoardsYet`: I18nKey = "broadcast:noBoardsYet"
val `boardsCanBeLoaded`: I18nKey = "broadcast:boardsCanBeLoaded"
val `startsAfter`: I18nKey = "broadcast:startsAfter"
val `startVerySoon`: I18nKey = "broadcast:startVerySoon"
val `notYetStarted`: I18nKey = "broadcast:notYetStarted"
val `officialWebsite`: I18nKey = "broadcast:officialWebsite"
val `standings`: I18nKey = "broadcast:standings"
val `iframeHelp`: I18nKey = "broadcast:iframeHelp"
val `webmastersPage`: I18nKey = "broadcast:webmastersPage"
val `pgnSourceHelp`: I18nKey = "broadcast:pgnSourceHelp"
val `embedThisBroadcast`: I18nKey = "broadcast:embedThisBroadcast"
val `embedThisRound`: I18nKey = "broadcast:embedThisRound"
val `ratingDiff`: I18nKey = "broadcast:ratingDiff"
val `gamesThisTournament`: I18nKey = "broadcast:gamesThisTournament"
val `score`: I18nKey = "broadcast:score"
val `nbBroadcasts`: I18nKey = "broadcast:nbBroadcasts"

object challenge:
Expand Down Expand Up @@ -2170,6 +2189,7 @@ object I18nKey:
val `showMeEverything`: I18nKey = "showMeEverything"
val `lichessPatronInfo`: I18nKey = "lichessPatronInfo"
val `nothingToSeeHere`: I18nKey = "nothingToSeeHere"
val `stats`: I18nKey = "stats"
val `opponentLeftCounter`: I18nKey = "opponentLeftCounter"
val `mateInXHalfMoves`: I18nKey = "mateInXHalfMoves"
val `nbBlunders`: I18nKey = "nbBlunders"
Expand Down
2 changes: 1 addition & 1 deletion modules/tournament/src/main/ui/UserTournament.scala
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ final class UserTournament(helpers: Helpers, ui: TournamentUi):
trans.arena.bestResults()
),
a(cls := path.active("chart"), href := routes.UserTournament.path(u.username, "chart"))(
trans.arena.stats()
trans.site.stats()
)
),
div(cls := "page-menu__content box")(body)
Expand Down
1 change: 0 additions & 1 deletion translation/source/arena.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ Play fast and return to the lobby to play more games and win more points.</strin
<string name="created">Created</string>
<string name="recentlyPlayed">Recently played</string>
<string name="bestResults">Best results</string>
<string name="stats">Stats</string>
<string name="tournamentStats">Tournament stats</string>
<string name="rankAvgHelp">The rank average is a percentage of your ranking. Lower is better.

Expand Down
22 changes: 21 additions & 1 deletion translation/source/broadcast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<string name="sourceGameIds">Up to 64 Lichess game IDs, separated by spaces.</string>
<string name="startDateTimeZone">Start date in the tournament local timezone: %s</string>
<string name="startDateHelp">Optional, if you know when the event starts</string>
<string name="credits">Credit the source</string>
<string name="currentGameUrl">Current game URL</string>
<string name="downloadAllRounds">Download all rounds</string>
<string name="resetRound">Reset this round</string>
Expand All @@ -50,4 +49,25 @@
<string name="ageThisYear">Age this year</string>
<string name="unrated">Unrated</string>
<string name="recentTournaments">Recent tournaments</string>
<string name="openLichess">Open in Lichess</string>
<string name="teams">Teams</string>
<string name="boards">Boards</string>
<string name="overview">Overview</string>
<string name="subscribeTitle">Subscribe to be notified when each round starts. You can toggle bell or push notifications for broadcasts in your account preferences.</string>
<string name="uploadImage">Upload tournament image</string>
<string name="noBoardsYet">No boards yet. These will appear once games are uploaded.</string>
<string name="boardsCanBeLoaded" comment="%s is 'Broadcaster App'">Boards can be loaded with a source or via the %s</string>
<string name="startsAfter">Starts after %s</string>
<string name="startVerySoon">The broadcast will start very soon.</string>
<string name="notYetStarted">The broadcast has not yet started.</string>
<string name="officialWebsite">Official website</string>
<string name="standings">Standings</string>
<string name="iframeHelp" comment="%s is 'webmasters page'">More options on the %s</string>
<string name="webmastersPage">webmasters page</string>
<string name="pgnSourceHelp" comment="%s is 'streaming API'">A public, real-time PGN source for this round. We also offer a %s for faster and more efficient synchronisation.</string>
<string name="embedThisBroadcast">Embed this broadcast in your website</string>
<string name="embedThisRound">Embed %s in your website</string>
<string name="ratingDiff">Rating diff</string>
<string name="gamesThisTournament">Games in this tournament</string>
<string name="score">Score</string>
</resources>
1 change: 1 addition & 0 deletions translation/source/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -993,4 +993,5 @@ Leave empty to start games from the normal initial position.</string>
<string name="lichessPatronInfo">Lichess is a charity and entirely free/libre open source software.
All operating costs, development, and content are funded solely by user donations.</string>
<string name="nothingToSeeHere">Nothing to see here at the moment.</string>
<string name="stats">Stats</string>
</resources>
48 changes: 44 additions & 4 deletions ui/@types/lichess/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ interface I18n {
shareUrl: I18nFormat;
/** Some tournaments are rated and will affect your rating. */
someRated: string;
/** Stats */
stats: string;
/** There is a countdown for your first move. Failing to make a move within this time will forfeit the game to your opponent. */
thereIsACountdown: string;
/** This is a private tournament */
Expand Down Expand Up @@ -231,6 +229,10 @@ interface I18n {
addRound: string;
/** Age this year */
ageThisYear: string;
/** Boards */
boards: string;
/** Boards can be loaded with a source or via the %s */
boardsCanBeLoaded: I18nFormat;
/** Broadcast calendar */
broadcastCalendar: string;
/** Broadcasts */
Expand All @@ -239,8 +241,6 @@ interface I18n {
completed: string;
/** Lichess detects round completion, but can get it wrong. Use this to set it manually. */
completedHelp: string;
/** Credit the source */
credits: string;
/** Current game URL */
currentGameUrl: string;
/** Definitively delete the round and all its games. */
Expand All @@ -257,6 +257,10 @@ interface I18n {
downloadAllRounds: string;
/** Edit round study */
editRoundStudy: string;
/** Embed this broadcast in your website */
embedThisBroadcast: string;
/** Embed %s in your website */
embedThisRound: I18nFormat;
/** Federation */
federation: string;
/** FIDE federations */
Expand All @@ -271,8 +275,12 @@ interface I18n {
fullDescription: string;
/** Optional long description of the tournament. %1$s is available. Length must be less than %2$s characters. */
fullDescriptionHelp: I18nFormat;
/** Games in this tournament */
gamesThisTournament: string;
/** How to use Lichess Broadcasts. */
howToUseLichessBroadcasts: string;
/** More options on the %s */
iframeHelp: I18nFormat;
/** Live tournament broadcasts */
liveBroadcasts: string;
/** My broadcasts */
Expand All @@ -281,8 +289,22 @@ interface I18n {
nbBroadcasts: I18nPlural;
/** New live broadcast */
newBroadcast: string;
/** No boards yet. These will appear once games are uploaded. */
noBoardsYet: string;
/** The broadcast has not yet started. */
notYetStarted: string;
/** Official website */
officialWebsite: string;
/** Ongoing */
ongoing: string;
/** Open in Lichess */
openLichess: string;
/** Overview */
overview: string;
/** A public, real-time PGN source for this round. We also offer a %s for faster and more efficient synchronisation. */
pgnSourceHelp: I18nFormat;
/** Rating diff */
ratingDiff: string;
/** Recent tournaments */
recentTournaments: string;
/** Optional: replace player names, ratings and titles */
Expand All @@ -293,6 +315,8 @@ interface I18n {
roundName: string;
/** Round number */
roundNumber: string;
/** Score */
score: string;
/** Show players scores based on game results */
showScores: string;
/** Up to 64 Lichess game IDs, separated by spaces. */
Expand All @@ -301,12 +325,22 @@ interface I18n {
sourceSingleUrl: string;
/** URL that Lichess will check to get PGN updates. It must be publicly accessible from the Internet. */
sourceUrlHelp: string;
/** Standings */
standings: string;
/** Optional, if you know when the event starts */
startDateHelp: string;
/** Start date in the tournament local timezone: %s */
startDateTimeZone: I18nFormat;
/** Starts after %s */
startsAfter: I18nFormat;
/** The broadcast will start very soon. */
startVerySoon: string;
/** Subscribed broadcasts */
subscribedBroadcasts: string;
/** Subscribe to be notified when each round starts. You can toggle bell or push notifications for broadcasts in your account preferences. */
subscribeTitle: string;
/** Teams */
teams: string;
/** The new round will have the same members and contributors as the previous one. */
theNewRoundHelp: string;
/** Top 10 rating */
Expand All @@ -319,6 +353,10 @@ interface I18n {
unrated: string;
/** Upcoming */
upcoming: string;
/** Upload tournament image */
uploadImage: string;
/** webmasters page */
webmastersPage: string;
};
challenge: {
/** Cannot challenge due to provisional %s rating. */
Expand Down Expand Up @@ -3939,6 +3977,8 @@ interface I18n {
starting: string;
/** Starting position */
startPosition: string;
/** Stats */
stats: string;
/** Streamer manager */
streamerManager: string;
/** Streamers */
Expand Down
3 changes: 0 additions & 3 deletions ui/analyse/css/study/relay/_tour.scss
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,6 @@ $hover-bg: $m-primary_bg--mix-30;
@extend %box-neat, %tour-margin-horiz;
background: $c-bg-zebra;
padding: 3em 2vw 1em 2vw;
h2 {
margin-bottom: 3rem;
}
}

&__players {
Expand Down
21 changes: 12 additions & 9 deletions ui/analyse/src/study/relay/relayPlayers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ export const playersView = (ctrl: RelayPlayers, tour: RelayTour): VNode =>
ctrl.show ? playerView(ctrl, ctrl.show, tour) : playersList(ctrl);

const ratingCategs = [
['standard', 'Classical'],
['rapid', 'Rapid'],
['blitz', 'Blitz'],
['standard', i18n.site.classical],
['rapid', i18n.site.rapid],
['blitz', i18n.site.blitz],
];

const playerView = (ctrl: RelayPlayers, show: PlayerToShow, tour: RelayTour): VNode => {
Expand Down Expand Up @@ -146,10 +146,12 @@ const playerView = (ctrl: RelayPlayers, show: PlayerToShow, tour: RelayTour): VN
]),
)
: []),
age ? h('div.relay-tour__player__card', [h('em', 'Age'), h('span', [age])]) : undefined,
age
? h('div.relay-tour__player__card', [h('em', i18n.broadcast.ageThisYear), h('span', [age])])
: undefined,
p.fed
? h('div.relay-tour__player__card', [
h('em', 'Federation'),
h('em', i18n.broadcast.federation),
h('a.relay-tour__player__fed', { attrs: { href: `/fide/federation/${p.fed.name}` } }, [
h('img.mini-game__flag', {
attrs: { src: site.asset.url(`images/fide-fed/${p.fed.id}.svg`) },
Expand All @@ -169,14 +171,15 @@ const playerView = (ctrl: RelayPlayers, show: PlayerToShow, tour: RelayTour): VN
: undefined,
p.performance
? h('div.relay-tour__player__card', [
h('em', 'Performance'),
h('em', i18n.site.performance),
h('span', [p.performance, p.games.length < 4 ? '?' : '']),
])
: undefined,
p.ratingDiff && h('div.relay-tour__player__card', [h('em', 'Rating diff'), ratingDiff(p)]),
p.ratingDiff &&
h('div.relay-tour__player__card', [h('em', i18n.broadcast.ratingDiff), ratingDiff(p)]),
]),
h('table.relay-tour__player__games.slist.slist-pad', [
h('thead', h('tr', h('td', { attrs: { colspan: 69 } }, 'Games in this tournament'))),
h('thead', h('tr', h('td', { attrs: { colspan: 69 } }, i18n.broadcast.gamesThisTournament))),
renderPlayerGames(ctrl, p, true),
]),
]
Expand Down Expand Up @@ -214,7 +217,7 @@ const renderPlayers = (ctrl: RelayPlayers, players: RelayPlayer[]): VNode => {
h('tr', [
h('th', 'Player'),
withRating ? h('th', !withScores && defaultSort, 'Elo') : undefined,
withScores ? h('th', defaultSort, 'Score') : h('th', 'Games'),
withScores ? h('th', defaultSort, 'Score') : h('th', i18n.site.games),
]),
),
h(
Expand Down
Loading

0 comments on commit 9f0c8c6

Please sign in to comment.