I think using the 'values' for the keys should be fine since each language name is unique. A key-clash would also help us catch mistakes like not differentiating sub-languages if support any (e.g. "English" vs. "English (British)")
Had to cast to String for lint.
- SUPPORTED_SUB_LANGUAGE_CODES[] that I introduced was pretty redundant when SUPPORTED_LANGUAGES[] already hold the information. The logic to ignore sub-languages (i.e. reduce the locale's "en-GB" to "en" is now located in getDefaultLanguage()).
- SUPPORTED_BROWSER_LANGUAGES[] and SUPPORTED_LANGUAGES[] look so similar and hard to tell what the former is for at first glance. The functionality to map 'zh-CN' to 'zh-Hans' is now handled by resolveLanguageAlias(), which makes the intention clearer.
This leaves us with a single list -- SUPPORTED_LANGUAGES[], whose key also tells us the desired language code to use.
Also, clients now need to call `resolveLanguageAlias` to map any language code aliases, as they differ depending on how it is queried (e.g. `navigator.language` vs. `app.getLocal()` uses different standards).
I think we no longer need to explicitly migrate existing user's 'zh-CN' into 'zh-Hans' because the rest of the system will always use the desired language code as long as 'resolveLanguageAlias' is called appropriately. e.g. the system uses `selectLanguage` and `selectLanguage` calls `resolveLanguageAlias`.
The removal is primarily to ease the upcoming language refactoring, but it was also never hit anyway, because if the `storedLanguage` is indeed null or undefined (like in the case of a fresh install), the `then` block never runs.
Fortunately, we do still get the effect of "falling back to OS's language", because `selectLanguage` will call `getDefaultLanguage` if `language` is null. While the `language` localStorage remains null, the rest of the code still gets the native language via `selectLanguage`.
Aside: `getDefaultLanguage` uses `navigator.language`. It does seem to grab my OS's locale correctly.
## Issue
Closes 5811: Video-embed in markdown-post is broken
- Revert "Fix 'makeSelectIsPlaying' to look at 'playing' instead of 'primary'." dabdc980a1.
- Revert "Fix 'isPlaying' to reflect 'playing' instead of 'primary' URI" 351890decf.
Reverting means "Deleting MD from downloads list causes spinning icon to run forever 4959" gets re-opened, but this is a way less severe issue to leave in.
Closes 5000: AutoPlay in Floating Player only works one time
Factor out the code that queries the recommendation. It needs to be called in two places:
(1) `RecommendedContent` - need to cover the case of floating player + visit another video page.
(2) When video is floating and autoplayed the next video.
## Issue
Closes#5720: Edit: channel-selector should re-populate with original channel
## Notes
'incognito' was not set to false, causing the 'ChannelSelector' to select Anonymous.