This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…to locale_fix_for_ie
Is this PR up to date with main? |
…to locale_fix_for_ie
@sdadn I just updated it from main and added a snapshot update per change it terra-button |
sdadn
approved these changes
Nov 9, 2023
sycombs
approved these changes
Nov 9, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces changes to
getBrowserLocale
method to accommodate the way IE navigator works with browser language.Why the change is needed
It has been reported that if the browser language is set to a different language, it translates correctly in all browsers but IE. The issue was pointed out to be coming from current implementation of the browser language being obtained from the navigator languages properties, which for IE differs from the rest of the browsers. Following tests indicated in favor of that:
I changed the language in IE browser from English to German and console logged the navigator language properties. I observed following:
It means that for IE the only navigator property that reflects the current browser language is
navigator.systemLanguage
.The current implementation of
getBrowserLocale
method does not usenavigator.systemLanguage
property, hence error in IE. It does work good for the rest of the browsers though, as they take the language from navigator languages array. I tested it by changing the language from English to German in Chrome, Firefox, Safari and Edge and received following console output:Testing
This change was tested using:
Following testing have been done for Chrome, Firefox, Safari and Edge:
Screenshots of navigator language props in IE, Edge, Chrome and Safari
A screenshot of navigator props in IE:
A screenshot of multiple languages with German being primary language logged for Edge:
A screenshot of German as an only language logged for Chrome:
A screenshot of Ukrainian as an only language in Safari:
Additional Details
This PR resolves:
UXPLATFORM-7942