-
Notifications
You must be signed in to change notification settings - Fork 910
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
Specify locale for strings that may differ from the chosen display locale #5624
Conversation
@@ -21,7 +21,7 @@ export default defineComponent({ | |||
{ | |||
icon: ['fab', 'github'], | |||
title: this.$t('About.Source code'), | |||
content: `<a href="https://github.com/FreeTubeApp/FreeTube">GitHub: FreeTubeApp/FreeTube</a><br>${this.$t('About.Licensed under the')} <a href="https://www.gnu.org/licenses/agpl-3.0.en.html">${this.$t('About.AGPLv3')}</a>` | |||
content: `<a href="https://github.com/FreeTubeApp/FreeTube" lang="en">GitHub: FreeTubeApp/FreeTube</a><br>${this.$t('About.Licensed under the')} <a href="https://www.gnu.org/licenses/agpl-3.0.en.html">${this.$t('About.AGPLv3')}</a>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should lang="en"
be added to other links too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any link in particular that you have in mind? I added it to this one because the display text is English, form what I can tell the rest of them on the about page either have the link itself as the display text or are translated, but I might have missed something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh they are translated? Did not check :)
* development: (21 commits) Fix playback of VOD/non-live videos with Invidious (FreeTubeApp#5654) Translated using Weblate (Bulgarian) Translated using Weblate (Japanese) Translated using Weblate (Bulgarian) Specify locale for strings that may differ from the chosen display locale (FreeTubeApp#5624) Added translation using Weblate (Afrikaans) Remove "Force Local Backend for Legacy Formats" setting (FreeTubeApp#5650) Change the hls manifest type to match the parser name shaka player registers (FreeTubeApp#5648) Fix incorrect/translated placeholders in locale files (FreeTubeApp#5628) Translated using Weblate (Portuguese (Brazil)) Translated using Weblate (Portuguese (Brazil)) Translated using Weblate (Turkish) Translated using Weblate (Czech) Translated using Weblate (Japanese) Translated using Weblate (French) Translated using Weblate (Japanese) Translated using Weblate (Hungarian) Translated using Weblate (Portuguese (Brazil)) Translated using Weblate (Chinese (Traditional Han script)) Translated using Weblate (Polish) ...
Specify locale for strings that may differ from the chosen display locale
Pull Request Type
Description
The MDN page for the HTML
lang
attribute, mentions that the Web Content Accessibility Guidelines require the page language to be specified and also that parts of the page in other languages require their language to be specified too, so that screenreaders can correctly pronounce and translate the text. FreeTube already fullfills the first part, as we set thelang
attribute on the<html>
element, however we don't currently fullfill the latter part.This pull request adds the
lang
attribute where we know that the language of the text may differ from the user's chosen locale preference and we know the language of the text e.g. locale preference selector (the locale names are in their own language), changelog (always in English). It does not add it in places where it may differ but we don't know the language of the text such as any text received from YouTube e.g. video titles, descriptions, channel names, comments etc, for those we just have to hope that the user is watching content in the same language as their locale preference.I decided to test the before and after with the Narrator built into Windows 10 with both the narrator and FreeTube set to English and was surprised at the results. Before these changes, for languages with non-Latin characters in their names such as Arabic and Bulgarian, it just annouced their position in the select box (x out of total), so you have no idea what you are currently focused on, whereas afterwards it announced the position and the English translation of the language name.
Screenshots
Testing
Quick and easy:
With the dev tools check that the
<option>
tags in the local preference select box have appropriatelang
attributes.Getting your hands dirty
Use a screen reader of your choice (e.g. built-in Narrator on Windows or VoiceOver on macOS) and see how it handles the newly added
lang
attributes.Desktop