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

[DONE] Fix : Accessibility for the media compatibility with the assistive tools (04.13) #919

2 changes: 2 additions & 0 deletions pod/chapter/static/js/videojs-chapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
var newA = document.createElement("a");
newA.setAttribute("id", "chapter" + chapId);
newA.setAttribute("start", chapTime);
newA.setAttribute("role", "button");
newA.setAttribute("tabindex", "0");

var newTitle = document.createTextNode(chapTitle);
newA.appendChild(newTitle);
Expand Down
Binary file modified pod/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
9 changes: 5 additions & 4 deletions pod/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 14:17+0000\n"
"POT-Creation-Date: 2023-08-30 07:35+0000\n"
"PO-Revision-Date: \n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: Pod Team [email protected]\n"
Expand Down Expand Up @@ -2591,8 +2591,8 @@ msgid ""
"This video '%(name)s' was uploaded to Pod; its origin is Youtube : <a href="
"\"%(url)s\" target=\"_blank\">%(url)s</a>"
msgstr ""
"Cette vidéo « %(name)s » a été téléversée sur Pod ; son origine est Youtube : "
"<a href=\"%(url)s\" target=\"_blank\">%(url)s</a>"
"Cette vidéo « %(name)s » a été téléversée sur Pod ; son origine est "
"Youtube : <a href=\"%(url)s\" target=\"_blank\">%(url)s</a>"

#: pod/import_video/views.py
msgid "YouTube error"
Expand Down Expand Up @@ -5539,7 +5539,8 @@ msgstr "Veuillez choisir si cette playlist est en lecture automatique ou non."
#| msgid "You cannot create a playlist named \"{FAVORITE_PLAYLIST_NAME}\""
msgid "You cannot create a playlist named \"{FAVORITE_PLAYLIST_NAME}\""
msgstr ""
"Vous ne pouvez pas créer une liste de lecture nommée \"{FAVORITE_PLAYLIST_NAME}\""
"Vous ne pouvez pas créer une liste de lecture nommée "
"\"{FAVORITE_PLAYLIST_NAME}\""

#: pod/playlist/forms.py
msgid "Remove playlist cannot be undone"
Expand Down
Binary file modified pod/locale/fr/LC_MESSAGES/djangojs.mo
Binary file not shown.
14 changes: 13 additions & 1 deletion pod/locale/fr/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Esup-Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 14:17+0000\n"
"POT-Creation-Date: 2023-08-30 07:35+0000\n"
"PO-Revision-Date: \n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -684,6 +684,18 @@ msgstr "La date doit être anterieure ou égale à"
msgid "The deletion date can’t be earlier than today."
msgstr "La date de suppression ne peut pas être antérieure à aujourd’hui."

#: pod/video/static/js/video-show.js
msgid "Seek back 10 seconds in the video"
msgstr "Reculer de 10 secondes dans la vidéo"

#: pod/video/static/js/video-show.js
msgid "Seek forward 10 seconds in the video"
msgstr "Avancer de 10 secondes dans la video"

#: pod/video/static/js/video-show.js
msgid "Quality"
msgstr "Qualité"

#: pod/video/static/js/video_category.js
msgid "Category changes saved successfully"
msgstr "Les changements sur la catégorie ont été sauvegardés avec succès"
Expand Down
4 changes: 2 additions & 2 deletions pod/locale/nl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 14:17+0000\n"
"POT-Creation-Date: 2023-08-30 07:35+0000\n"
"PO-Revision-Date: 2023-06-08 14:37+0200\n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -2385,7 +2385,7 @@ msgstr ""

#: pod/import_video/utils.py
#, python-format
msgid "The size of the video file exceeds the maximum allowed value (%s Gb)."
msgid "The size of the video file exceeds the maximum allowed value, %s Gb."
msgstr ""

#: pod/import_video/views.py
Expand Down
14 changes: 13 additions & 1 deletion pod/locale/nl/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Esup-Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 14:17+0000\n"
"POT-Creation-Date: 2023-08-30 07:35+0000\n"
"PO-Revision-Date: 2023-02-08 15:22+0100\n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -659,6 +659,18 @@ msgstr ""
msgid "The deletion date can’t be earlier than today."
msgstr ""

#: pod/video/static/js/video-show.js
msgid "Seek back 10 seconds"
msgstr ""

#: pod/video/static/js/video-show.js
msgid "Seek forward 10 seconds"
msgstr ""

#: pod/video/static/js/video-show.js
msgid "Quality"
msgstr ""

#: pod/video/static/js/video_category.js
msgid "Category changes saved successfully"
msgstr ""
Expand Down
37 changes: 37 additions & 0 deletions pod/video/static/js/video-show.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var translationDone = false;

document.getElementById('podvideoplayer_html5_api').addEventListener('play', function () {
if (!translationDone) {
const elementToTranslateList = [
['.skip-back', gettext('Seek back 10 seconds in the video')],
['.skip-forward', gettext('Seek forward 10 seconds in the video')],
['.vjs-quality-selector', gettext('Quality')],
]
for (let elementToTranslate of elementToTranslateList) {
translateTitleOfVideoPlayerButton(elementToTranslate[0], elementToTranslate[1]);
}
const resetTrackSettingsButton = document.querySelector('.vjs-track-settings-controls>.vjs-default-button');
if (resetTrackSettingsButton) {
resetTrackSettingsButton.setAttribute('aria-label', resetTrackSettingsButton.getAttribute('title'));
}
}
});


/**
* Translate the title of the video player button.
*
* @param {string} querySelectorButton The query selector for the button.
* @param {string} title The title.
*/
function translateTitleOfVideoPlayerButton(querySelectorButton, title) {
let translatedTitle = title;
const videoPlayerButton = document.querySelector(querySelectorButton);
if (videoPlayerButton) {
const videoPlayerSpan = videoPlayerButton.querySelector('.vjs-control-text');
videoPlayerButton.title = translatedTitle;
if (videoPlayerSpan) {
videoPlayerSpan.textContent = translatedTitle;
}
}
}
2 changes: 1 addition & 1 deletion pod/video/templates/videos/video-element.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{% endif %}
<div id="chapter-for-playlist">
{% if video.chapter_set.all %}
<div class="chapters-list inactive" role="menu">
<div class="chapters-list inactive">
<h6><span class="vjs-icon-chapters"></span>{% trans "Chapters" %}</h6>
<ol id="chapters-list"></ol>
</div>
Expand Down
1 change: 1 addition & 0 deletions pod/video/templates/videos/video-script.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,4 @@
}
initialized_player()
</script>
<script src="{% static 'js/video-show.js' %}?ver={{VERSION}}"></script>