Bug 226361 - [Modern Media Controls] put the localized information for tracks first if the track is not in the user's preferred language
Summary: [Modern Media Controls] put the localized information for tracks first if the...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks: 226742 232642
  Show dependency treegraph
 
Reported: 2021-05-27 16:08 PDT by Devin Rousso
Modified: 2021-11-02 15:17 PDT (History)
9 users (show)

See Also:


Attachments
Patch (45.76 KB, patch)
2021-05-27 16:33 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2021-05-27 16:08:13 PDT
this makes it clearer/easier for the user to understand what's going on when the track label is not in the user's preferred language
Comment 1 Devin Rousso 2021-05-27 16:08:26 PDT
<rdar://problem/78497853>
Comment 2 Devin Rousso 2021-05-27 16:33:34 PDT
Created attachment 429951 [details]
Patch
Comment 3 Eric Carlson 2021-05-28 09:23:30 PDT
Comment on attachment 429951 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=429951&action=review

> Source/WebCore/ChangeLog:31
> +        This makes it clearer/easier for the user to understand what's going on when the track label
> +        is not in the user's preferred language. For example, if a `<video>` has an "English" audio
> +        track, it's not very helpful to show "English (è±è¯­)" for Chinese users instead of something
> +        like "è±è¯­ (English)".
> +
> +        If the track has a `label` and either matches the user's preferred language or its `label`
> +        already contains the localized language name, combine the track's `label` with a localized
> +        description of the track if that description isn't already in the `label`. Otherwise, add
> +        the localized language name first, then the description of the track, and finally the `label`.
> +
> +        Here are some examples if the user's preferred language is English:
> +         - `<track kind="subtitles" srclang="en">`                  would show "English"
> +         - `<track kind="subtitles" srclang="en" label="Foo">`      would show "Foo"
> +         - `<track kind="captions"  srclang="en">`                  would show "English Captions"
> +         - `<track kind="captions"  srclang="en" label="Foo">`      would show "Foo Captions"
> +         - `<track kind="captions"  srclang="en" label="Captions">` would show "Captions"
> +         - `<track kind="subtitles" srclang="fr">`                  would show "French"
> +         - `<track kind="subtitles" srclang="fr" label="Foo">`      would show "French (Foo)"
> +         - `<track kind="captions"  srclang="fr">`                  would show "French Captions"
> +         - `<track kind="captions"  srclang="fr" label="Foo">`      would show "French Captions (Foo)"
> +         - `<track kind="captions"  srclang="fr" label="Captions">` would show "French Captions"

This is a fantastic explanation!
Comment 4 EWS 2021-05-28 09:39:49 PDT
Committed r278202 (238245@main): <https://commits.webkit.org/238245@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 429951 [details].