Bug 226361

Summary: [Modern Media Controls] put the localized information for tracks first if the track is not in the user's preferred language
Product: WebKit Reporter: Devin Rousso <hi>
Component: MediaAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, ews-watchlist, glenn, hi, jer.noble, peng.liu6, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 226742, 232642    
Attachments:
Description Flags
Patch none

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].