Description of problem:
Korean timestamps are shown when users' language preferences are set to (in order of priority): German (de), English (en), and English-U.S. (en-U.S.).
The issue was also reported by Christoph Jerolimov using de-DE,de;q=0.9,en-DE;q=0.8,en;q=0.7,en-US;q=0.6.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Clear local storage.
2. Set browser language preferences to German, English, and Enlish-U.S.
The application is shown in English with Korean timestamps.
The application is shown in English.
Console messages show that i18next::backendConnector language en and then registered a languageChanged event for de as expected.
This appears to happen for other language we don't offer support for (I checked Spanish as well).
It looks like Moment.js is the source of the Korean timestamps issue -- it's reporting that it's in Korean. I'm looking into the way we're using it for interpolation to see if I can find the source of the issue. i18next browser detection is working as intended and i18next is reporting that it's using German as expected.
Moment is showing timestamps in Korean because it was the most recently imported Moment.js locale. Changing the imports so Chinese is the last will mean the timestamps are in Chinese.
I suspect this was caused by a relatively recent switch to hard-coding the languages instead of using a single data structure across the application. We switched because it was causing issues with the parser. I think Moment doesn't know how to handle locales we haven't specifically imported and requires us to set a default.
Checked on ocp 4.7 cluster with payload 4.7.0-0.nightly-2020-12-20-031835.
Set browser language preferences to German, English, Chinese, open the console, it shows contexts in English by default now and timestamps are correct.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.