-
Notifications
You must be signed in to change notification settings - Fork 80
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
Describe session-based language switching in docs #27
Comments
this was just topic of conversation in IRC, and I took a crack at it, in the following gist is the work around I came up with. https://gist.github.com/Zauberfisch/9226142 I simply hook into controller init and use session to remember the locale. |
@Zauberfisch Apologies for not looking at this in depth, but do you think it's worth migrating some of that initialisation into a RequestFilter? See https://github.com/silverstripe/silverstripe-framework/blob/3.1/control/VersionedRequestFilter.php for how Versioned does this. I plan on using the same design pattern for the Fluent module once I get some time. :) |
hmm, what would be the benefit of hooking into |
It wouldn't require a controller instance to do the initialisation of the locale. Probably... :) It's also supposed to be the 'correct' way to do request-based pre-setup and post-teardown initialisation. |
Unfortunately, Silverstripe CMS 3 has entered limited support in June 2018. This means we'll only be fixing critical bugs and security issues for Silverstripe CMS 3 going forward. You can read the Silverstripe CMS Roadmap for more information on our support commitments. |
Migrated from http://open.silverstripe.org/ticket/7044
Followup from #7041
The "Switching languages" section mentions the ?locale= GET param, and using that param would only show links to pages in a certain language. But some pages are statically linked, e.g. Security/login. Describe how to work around this by using session based locales through init(). Also fix usage of Translatable::set_reading_locale().
The text was updated successfully, but these errors were encountered: