Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate board menu in puzzle and game #16551

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/coreI18n/src/main/key.scala
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ object I18nKey:
val `timezone`: I18nKey = "broadcast:timezone"
val `fideRatingCategory`: I18nKey = "broadcast:fideRatingCategory"
val `optionalDetails`: I18nKey = "broadcast:optionalDetails"
val `upcomingBroadcasts`: I18nKey = "broadcast:upcomingBroadcasts"
val `pastBroadcasts`: I18nKey = "broadcast:pastBroadcasts"
val `allBroadcastsByMonth`: I18nKey = "broadcast:allBroadcastsByMonth"
val `nbBroadcasts`: I18nKey = "broadcast:nbBroadcasts"
Expand Down Expand Up @@ -1134,6 +1133,9 @@ object I18nKey:
val `notifyWeb`: I18nKey = "preferences:notifyWeb"
val `notifyDevice`: I18nKey = "preferences:notifyDevice"
val `bellNotificationSound`: I18nKey = "preferences:bellNotificationSound"
val `blindFold`: I18nKey = "preferences:blindFold"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the capital F? Everywhere else it's just blindfold

val `voiceInput`: I18nKey = "preferences:voiceInput"
Copy link
Collaborator

@ornicar ornicar Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a translation already exists, inputMovesWithVoice

val `keyboardInput`: I18nKey = "preferences:keyboardInput"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a translation already exists, inputMovesWithTheKeyboard


object puzzle:
val `puzzles`: I18nKey = "puzzle:puzzles"
Expand Down
3 changes: 3 additions & 0 deletions translation/source/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@
<string name="notifyWeb">Browser</string>
<string name="notifyDevice">Device</string>
<string name="bellNotificationSound">Bell notification sound</string>
<string name="blindFold" comment="As in Blindfold chess">Blindfold</string>
<string name="voiceInput">Voice input</string>
<string name="keyboardInput">Keyboard input</string>
</resources>
6 changes: 6 additions & 0 deletions ui/@types/lichess/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2065,6 +2065,8 @@ interface I18n {
preferences: {
/** Bell notification sound */
bellNotificationSound: string;
/** Blindfold */
blindFold: string;
/** Board coordinates (A-H, 1-8) */
boardCoordinates: string;
/** Board highlights (last move and check) */
Expand Down Expand Up @@ -2121,6 +2123,8 @@ interface I18n {
inputMovesWithTheKeyboard: string;
/** Input moves with your voice */
inputMovesWithVoice: string;
/** Keyboard input */
keyboardInput: string;
/** Material difference */
materialDifference: string;
/** Move confirmation */
Expand Down Expand Up @@ -2187,6 +2191,8 @@ interface I18n {
takebacksWithOpponentApproval: string;
/** Tenths of seconds */
tenthsOfSeconds: string;
/** Voice input */
voiceInput: string;
/** When premoving */
whenPremoving: string;
/** When time remaining < 10 seconds */
Expand Down
8 changes: 4 additions & 4 deletions ui/common/src/boardMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class BoardMenu {

zenMode = (enabled = true): VNode =>
this.cmnToggle({
name: 'Zen mode',
name: i18n.preferences.zenMode,
id: 'zen',
checked: $('body').hasClass('zen'),
change: () => pubsub.emit('zen'),
Expand All @@ -53,7 +53,7 @@ export class BoardMenu {

voiceInput = (toggle: Toggle, enabled = true): VNode =>
this.cmnToggle({
name: 'Voice input',
name: i18n.preferences.voiceInput,
id: 'voice',
checked: toggle(),
change: toggle,
Expand All @@ -63,7 +63,7 @@ export class BoardMenu {

keyboardInput = (toggle: Toggle, enabled = true): VNode =>
this.cmnToggle({
name: 'Keyboard input',
name: i18n.preferences.keyboardInput,
id: 'keyboard',
checked: toggle(),
change: toggle,
Expand All @@ -73,7 +73,7 @@ export class BoardMenu {

blindfold = (toggle: Toggle, enabled = true): VNode =>
this.cmnToggle({
name: 'Blindfold',
name: i18n.preferences.blindFold,
id: 'blindfold',
checked: toggle(),
change: toggle,
Expand Down
6 changes: 1 addition & 5 deletions ui/puzzle/src/view/boardMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ export default function (ctrl: PuzzleCtrl) {
menu.keyboardInput(boolPrefXhrToggle('keyboardMove', !!ctrl.keyboardMove), true),
]),
h('section.board-menu__links', [
h(
'a',
{ attrs: { target: '_blank', href: '/account/preferences/display' } },
'Game display preferences',
),
h('a', { attrs: { target: '_blank', href: '/account/preferences/display' } }, i18n.preferences.display),
]),
]);
}
4 changes: 2 additions & 2 deletions ui/round/src/view/boardMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ export default function (ctrl: RoundController): LooseVNode {
h(
'a',
{ attrs: { target: '_blank', href: '/account/preferences/display' } },
'Game display preferences',
i18n.preferences.display,
),
h(
'a',
{ attrs: { target: '_blank', href: '/account/preferences/game-behavior ' } },
'Game behavior preferences',
i18n.preferences.gameBehavior,
),
]),
];
Expand Down
Loading