WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/01/2019 10:04:43 PM (6 weeks ago)
Author:
afercia
Message:

Accessibility: Media: Allow users to set a proper language for Video subtitles.

For a number of years, subtitles track added to videos were always set to "English" regardless of the actual subtitles language.

By making the track srclang, label, and kind attributes editable, content authors are now able to set a language that matches the actual track content.

Props BjornW, audrasjb, birgire, karmatosed, sabernhardt, afercia.
Fixes #47559.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media-template.php

    r46363 r46373  
    13561356                    if ( ! _.isEmpty( data.model.content ) ) {
    13571357                        var tracks = jQuery( data.model.content ).filter( 'track' );
    1358                         _.each( tracks.toArray(), function (track) {
     1358                        _.each( tracks.toArray(), function( track, index ) {
    13591359                            content += track.outerHTML; #>
    1360                         <label for="video-details-track" class="name"><?php _e( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ); ?></label>
    1361                         <input class="content-track" type="text" id="video-details-track" readonly value="{{ track.outerHTML }}" />
    1362                         <button type="button" class="button-link remove-setting remove-track"><?php _ex( 'Remove video track', 'media' ); ?></button>
     1360                        <label for="video-details-track-{{ index }}" class="name"><?php _e( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ); ?></label>
     1361                        <input class="content-track" type="text" id="video-details-track-{{ index }}" aria-describedby="video-details-track-desc-{{ index }}" value="{{ track.outerHTML }}" />
     1362                        <span class="description" id="video-details-track-desc-{{ index }}">
     1363                        <?php
     1364                            printf(
     1365                                /* translators: 1: "srclang" HTML attribute, 2: "label" HTML attribute, 3: "kind" HTML attribute. */
     1366                                __( 'The %1$s, %2$s, and %3$s values can be edited to set the video track language and kind.' ),
     1367                                'srclang',
     1368                                'label',
     1369                                'kind'
     1370                            );
     1371                        ?>
     1372                        </span>
     1373                        <button type="button" class="button-link remove-setting remove-track"><?php _ex( 'Remove video track', 'media' ); ?></button><br/>
    13631374                        <# } ); #>
    13641375                    <# } else { #>
Note: See TracChangeset for help on using the changeset viewer.