Bug 1907543
Summary: | Korean timestamps are shown when users' language preferences are set to German-en-en-US | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | ralpert |
Component: | Management Console | Assignee: | ralpert |
Status: | CLOSED ERRATA | QA Contact: | Yadan Pei <yapei> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 4.7 | CC: | aballant, aos-bugs, cjerolim, jokerman, yanpzhan |
Target Milestone: | --- | ||
Target Release: | 4.7.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
Cause: We use Moment.js for timestamps. There was no default language set for Moment.js. If we didn't support the language being displayed, Moment seemed to default to the last imported locale.
Consequence: Korean timestamps were displayed since it was the last imported locale.
Fix: Added English as a default.
Result: English and English timestamps are now shown if the user tries to use OpenShift in a language we don't support.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2021-02-24 15:43:42 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
ralpert
2020-12-14 17:06:37 UTC
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. https://access.redhat.com/errata/RHSA-2020:5633 |