magiclabs/alchemy_cms — pull request #628 by mamhoff (2014-09-02 09:46:27+00:00)
Title: Fix locale setting in some circumstances

I've had issues with ::I18n.locale not being set correctly on a
multi-language site. On my installation, ```#set_alchemy_language```
would sometimes be called after ```#set_locale```, which was the reason
for that strange behaviour. Actively marking ```#set_aclhemy_language```
as a prepend_before_action, thereby specifying the sequence of things, fixed that.

However, I could not (for the love of god) reproduce the failing behaviour
in a test. This is why there is no test for this.

Things were complicated further by ```#set_alchemy_language``` being
called in the default ```else``` branch of ```PagesController#render_page_or_redirect```.
There should in my opinion never be a case where the page has a different language
than ```Language.current```, as it is scoped against that in ```PagesController#load_page```.

In the interest of simplification, I removed that line.

If someone has an idea of how to reproduce the strange behaviour,
I'd be happy to include a test.