Skip to content

Commit

Permalink
Added translations to play/pause button plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ferserc1 committed May 16, 2024
1 parent 5e0a05b commit 4b17175
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
4 changes: 3 additions & 1 deletion src/i18n/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,7 @@
"Swap between side by side and minimized video": "Wechsel zwischen Video nebeneinander und minimiert",
"Swap the position of the videos": "Wechsel der Videopositionen",
"Dual stream 50%": "Dual-Stream 50%",
"Two videos 50%": "Zwei Videos 50%"
"Two videos 50%": "Zwei Videos 50%",
"play": "spielen",
"pause": "pause"
}
4 changes: 3 additions & 1 deletion src/i18n/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,7 @@
"Swap between side by side and minimized video": "Cambiar la disposición de los dos vídeos entre minimizado y del mismo tamaño",
"Swap the position of the videos": "Intercambiar la posición de los vídeos",
"Dual stream 50%": "Dos streams al 50%",
"Two videos 50%": "Dos streams al 50%"
"Two videos 50%": "Dos streams al 50%",
"play": "reproducir",
"pause": "pausar"
}
24 changes: 12 additions & 12 deletions src/js/plugins/es.upv.paella.playPauseButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,27 @@ export default class PlayButtonPlugin extends ButtonPlugin {
const shortcutKey = this.config.ariaKeyshortcuts || "k";
bindEvent(this.player, Events.PLAY, () => {
this.icon = pauseIcon;
this._button.ariaKeyshortcuts = this.config.ariaKeyshortcuts || shortcutKey ;
this._button.ariaLabel = this.config.ariaLabelPause || titlePause;
this._button.title = this.config.ariaLabelPause || titlePause;
this.button.ariaKeyshortcuts = shortcutKey;
this.button.ariaLabel = titlePause;
this.button.title = titlePause;
});
bindEvent(this.player, Events.PAUSE, () => {
this.icon = playIcon;
this._button.ariaKeyshortcuts = this.config.ariaKeyshortcuts || shortcutKey ;
this._button.ariaLabel = this.config.ariaLabelPause || titlePlay ;
this._button.title = this.config.ariaLabelPause || titlePlay;
this.button.ariaKeyshortcuts = shortcutKey;
this.button.ariaLabel = titlePlay;
this.button.title = this.config.ariaLabelPause || titlePlay;
});

This comment has been minimized.

Copy link
@karendolan

karendolan May 24, 2024

Contributor

Hi @ferserc1 and @miesgre, my pull had a bug! These last 3 binds should have been this.config.ariaLabelPlay, not this.config.ariaLabelPause.
When I remove my config play and pause attributes, the button title is correct. But when I add them, the ariaLabelPause incorrectly shows.

bindEvent(this.player, Events.ENDED, () => {
this.icon = replayIcon;
this._button.ariaKeyshortcuts = this.config.ariaKeyshortcuts || shortcutKey ;
this._button.ariaLabel = this.config.ariaLabelPause || titlePlay ;
this._button.title = this.config.ariaLabelPause || titlePlay;
this.button.ariaKeyshortcuts = shortcutKey;
this.button.ariaLabel = titlePlay;
this.button.title = this.config.ariaLabelPause || titlePlay;
});
bindEvent(this.player, Events.STOP, () => {
this.icon = playIcon;
this._button.ariaKeyshortcuts = this.config.ariaKeyshortcuts || shortcutKey ;
this._button.ariaLabel = this.config.ariaLabelPause || titlePlay ;
this._button.title = this.config.ariaLabelPause || titlePlay;
this.button.ariaKeyshortcuts = shortcutKey;
this.button.ariaLabel = titlePlay;
this.button.title = this.config.ariaLabelPause || titlePlay;
});
}

Expand Down

0 comments on commit 4b17175

Please sign in to comment.