Skip to content
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

feat: add new setting to allow / disallow custom user locale lookup #5444

Merged
merged 6 commits into from
Aug 12, 2019

Conversation

kieckhafer
Copy link
Member

Same as #5442 but hopefully with all the commits that weren't being seen in that PR.

Impact: minor
Type: feature|refactor

Issue

When checking a users locale, we hit an external server every time the app refreshes, which can be taxing on performance, and cost.

Solution

Add an option to not allow custom user locales, which will skip this check and use the default store locale. This can be beneficial for any shop which doesn't wish to take the performance hit of the constant external server hit, and also for shops which only have one language / currency and a locale check is not needed.

Breaking changes

None. By default, the old settings of checking the locale are enable.

Testing

Since we don't have an IP address that's locale based when developing locally, the easiest way to test is to console.log inside of this check, and see that the log shows / doesn't show depending on the settings: https://github.com/reactioncommerce/reaction/blob/refactor-kieckhafer-customUserLocaleOption/imports/plugins/core/core/server/methods/shop/getLocale.js#L57

@rosshadden rosshadden merged commit 5762111 into develop Aug 12, 2019
@rosshadden rosshadden deleted the refactor-kieckhafer-customUserLocaleOption branch August 12, 2019 22:22
@kieckhafer kieckhafer mentioned this pull request Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants