WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 3 weeks ago

#47559 accepted defect (bug)

Subtitle tracks use English as default (hardcoded) in track element srclang and label attributes

Reported by: BjornW Owned by: audrasjb
Milestone: 5.3 Priority: normal
Severity: normal Version: 5.2.2
Component: Media Keywords: needs-patch has-screenshots needs-design-feedback
Focuses: ui, accessibility, javascript Cc:

Description (last modified by afercia)

Currently (using version 5.2.2) adding a subtitle is needlessly opaque as you can see in the attached screencast. As far as I can tell, it is only possible via the video widget if someone presses the 'edit video' button.

I'd consider this a quite annoying usability issue which I think we need to address rather sooner than later since subtitles are considered best practices for accessibility. Not to mention required for WCAG compliance.

A user might accidentally press the edit video button in the video widget, but nothing indicates that they are able to add subtitles via this button. Adding video via the Gutenberg video block doesn't help either. It has no option to add subtitles at all.

The other issue is that any subtitle added to a video is considered English. Regardless of the contents of the subtitle file's language or the language chosen in WordPress. This is clearly a bug, although while grepping through the trunk source I noticed srclang has been set to 'English' hardcoded.

As the current UI/UX for adding subtitles is already problematic (to say the least), adding an option to set the subtitle label and scrlang attributes feels like polishing a turd.

I'd like to discuss possible solutions to solve this issue and I'm willing to help out with this provided a Core committer commits to solving this issue as well. Without a Core committer I'm not willing to spend any time on patches since they'll probably be lingering for months or even years.

PS: Sorry about the numbers linking (can't edit this) in the attached screencast description.

Attachments (4)

subtitle-issue-edit.mp4 (3.7 MB) - added by BjornW 3 months ago.
Screencast of subtitle issues #1 adding is way too hard #2 Any subtitle added is considered English even when not..
screenshot-2019-06-28_22-09-13.png (203.4 KB) - added by BjornW 3 months ago.
Screenshot of video block in Gutenberg editor has no option to set subtitles
screenshot-2019-06-28_22-20-04.png (272.6 KB) - added by BjornW 3 months ago.
Press the edit video button to add subtitles. As far as I can tell this is the only way to add subtitles…
Capture d’écran 2019-08-10 à 11.36.58.png (163.9 KB) - added by audrasjb 6 weeks ago.
Proposal: manual language selector

Change History (23)

#1 @SergeyBiryukov
3 months ago

  • Component changed from General to Media

@BjornW
3 months ago

Screencast of subtitle issues #1 adding is way too hard #2 Any subtitle added is considered English even when not..

@BjornW
3 months ago

Screenshot of video block in Gutenberg editor has no option to set subtitles

@BjornW
3 months ago

Press the edit video button to add subtitles. As far as I can tell this is the only way to add subtitles...

#2 @BjornW
3 months ago

  • Focuses ui accessibility added
  • Version set to 5.2.2

Currently (using version 5.2.2) adding a subtitle is needlessly opaque as you can see in the attached screencast. As far as I can tell, it is only possible via the video widget if someone presses the 'edit video' button.

I'd consider this a quite annoying usability issue which I think we need to address rather sooner than later since subtitles are considered best practices for accessibility. Not to mention required for WCAG compliance.

A user might accidentally press the edit video button in the video widget, but nothing indicates that they are able to add subtitles via this button. Adding video via the Gutenberg video block doesn't help either. It has no option to add subtitles at all.

The other issue is that any subtitle added to a video is considered English. Regardless of the contents of the subtitle file's language or the language chosen in WordPress. This is clearly a bug, although while grepping through the trunk source I noticed srclang has been set to 'English' hardcoded.

As the current UI/UX for adding subtitles is already problematic (to say the least), adding an option to set the subtitle label and scrlang attributes feels like polishing a turd.

I'd like to discuss possible solutions to solve this issue and I'm willing to help out with this provided a Core committer commits to solving this issue as well. Without a Core committer I'm not willing to spend any time on patches since they'll probably be lingering for months or even years.

PS: Sorry about the numbers linking (can't edit this) in the attached screencast description.

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


2 months ago

#4 follow-up: @afercia
2 months ago

  • Focuses javascript added
  • Keywords needs-patch has-screenshots added
  • Milestone changed from Awaiting Review to 5.3

Discussed during today's accessibility bug scrub and agreed this is something to fix.

The inability to properly set the language is, well a bit unfortunate and should definitely be fixed. Also the UI should make this task easier.

Proposing for 5.3 consideration.

#5 in reply to: ↑ 4 @BjornW
2 months ago

Hi @afercia,

Great to hear this issue is considered for 5.3. What's the next step in making this happen? Is there already a plan for fixing the UI/UX for the subtitles? Or is this something we need to discuss?

#6 @afercia
2 months ago

Hello @BjornW! For Gutenberg, there's already this issue (created 1 year ago at the time of writing) with some UI explorations: https://github.com/WordPress/gutenberg/issues/7673

Discussion with the media and design teams would certainly help in framing the steps to take. For now, I'd tend to think the best option would be focusing on the functionality part. Specifically: find a way to get a list of languages (language code / language name) and make it available in the media views. Once that works, focus on the UI, both in the Classic Editor and in Gutenberg.

Any help would be greatly appreciated so if you're willing to start exploring, that would be very welcome!

#7 @audrasjb
6 weeks ago

  • Owner set to audrasjb
  • Status changed from new to accepted

@audrasjb
6 weeks ago

Proposal: manual language selector

#8 @audrasjb
6 weeks ago

  • Description modified (diff)
  • Keywords needs-design-feedback added

#9 @audrasjb
6 weeks ago

Hi there,

I tried a workaround (see screenshot above): add a language selector so we can populate both srclang and label attributes.

Works fine on my side, adding needs-design-feedback keyword since we'll need a design feedback before making a proper patch.

(I also commented in the related Gutenberg GitHub issue)

Cheers,
Jb

#10 @audrasjb
6 weeks ago

  • Description modified (diff)

#11 follow-up: @audrasjb
6 weeks ago

OMG I removed the initial description…
That would be cool if someone could restore the initial version please, looks like I can't do that :\

#12 in reply to: ↑ 11 @birgire
6 weeks ago

Replying to audrasjb:

OMG I removed the initial description…
That would be cool if someone could restore the initial version please, looks like I can't do that :\

I don't see the initial description in Trac's revision

https://core.trac.wordpress.org/ticket/47559?version=0

https://core.trac.wordpress.org/ticket/47559?action=history

https://core.trac.wordpress.org/ticket/47559?sfp_email=&sfph_mail=&action=diff&version=8&old_version=0

Can it be that it was initially without description?

#13 follow-up: @BjornW
5 weeks ago

@audrasjb thanks for helping out with this issue!

Is the language dropdown still only available via the video widget if someone presses the 'edit video' button? Where do the languages used as options come from (how can this be extended?)? Would it be possible to derive the language from the subtitle file without options?

Adding the dropdown, does not (yet) solve the surrounding issue of finding this setting. What are your ideas about solving this (and how does this relate with Gutenberg?)

#14 in reply to: ↑ 13 @audrasjb
5 weeks ago

Replying to BjornW:

Is the language dropdown still only available via the video widget if someone presses the 'edit video' button?

Yes of course. That was even the place where I worked, which was easier for me since I'm widgets screen component maintainer.

Where do the languages used as options come from (how can this be extended?)?

In this workaround, I only copied WordPress language dropdown available WP Admin General Settings.

Would it be possible to derive the language from the subtitle file without options?

I don't think so, because as far as I know there is no meta data tags in subtitle files.

Adding the dropdown, does not (yet) solve the surrounding issue of finding this setting. What are your ideas about solving this (and how does this relate with Gutenberg?)

It is not related to Gutenberg in my opinion. It is related to interface design (in the broader sense of design – aka not only graphic design) and to WordPress Documentation ("Where can I find these settings?").

#15 @afercia
4 weeks ago

  • Description modified (diff)

#16 @afercia
4 weeks ago

  • Description modified (diff)

#17 @afercia
4 weeks ago

Did I restore the correct initial description? :)

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


3 weeks ago

#19 @afercia
3 weeks ago

Discussed during today's accessibility bug-scrub. Agreed the new select to pick a language doesn’t seem to greatly impact the UI from a visual perspective. Some design feedback would be nice :) /Cc @karmatosed

Note: See TracTickets for help on using tickets.