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

allows apps to push users to the locale forwarder if app locale doesnt match the users choice #804

Closed
andy-berry-dev opened this issue Jul 7, 2014 · 4 comments
Assignees
Milestone

Comments

@andy-berry-dev
Copy link
Member

Create a mechanism that (optionally) allows apps to push users back to the locale forwarder if the current app locale doesn't match the locale calculated from the locale cookie and browser headers.

This will allow users to refresh the page after changing their locale since after the refresh the locales wont match and the browser will be sent to the locale forwarder. It also means if locale pages are bookmarked the correct locale will ultimately still be used.

@andy-berry-dev
Copy link
Member Author

This should maybe be a number of utilities on the locale service instead. That way the developer of the app can decide whether to immediately forward the user, ignore the difference in locale of display a warning.

We already have a mechanism for determining the preferred locale and the current locale. We probably want one more method to get the locale the user should be viewing.

@thecapdan
Copy link
Contributor

failing test above should be for issue 802. can be ignored for this issue

@dchambers
Copy link
Contributor

Now that #1186 has been done, we should add the extra requirement that LocaleSwitcher.switch() should work regardless of when it's invoked (i.e. it should be possible to invoke it from the app too, in addition to the locale-switching page), so that the following code should work:

require('br-locale/switcher').switchLocale('en');

for both types of multi-locale app:

  1. Forwarding Style Multi-Locale Apps
  2. Non-Forwarding Style Multi-Locale Apps

@thanhc
Copy link
Contributor

thanhc commented Mar 9, 2015

tested locale switching with both forwarding and non-forwarding styles and both works, although found an issue with aliasing while testing this, raised #1268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants