-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STRF-7438 fix stencil language translation in Safari #186
STRF-7438 fix stencil language translation in Safari #186
Conversation
8c8d9f4
to
18ed2ea
Compare
7365a43
to
5c4b5e8
Compare
5c4b5e8
to
796b2ab
Compare
lib/translator/locale-parser.js
Outdated
|
||
// Safari sends only one language code, this is to have a default fallback in case we don't have that language | ||
// As an example we may not have fr-FR so add fr to the header | ||
if (localesArr.length === 1 && localesArr[0].split('-').length === 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work? I thought localesArr[0]
would be an object, not a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localesArr[0] would be an object after acceptlanguageparser.parse but I'm doing this after the map function which makes things into an array of strings.
796b2ab
to
3cc2e3f
Compare
This should fix the issue of Safari only sending the most preferred language's code. If the most preferred language's code does not exist then we go to the fallback for that language such as fr-CA to fr. If neither of these locales exist then we fallback to English. Tested in safari browser.
https://jira.bigcommerce.com/browse/STRF-7438