jamuhl/i18next-node — Issue #9: $.i18n.setLng how should affect client-server behaviour?
Author: panosru
Created: 2012-02-02 02:15:25+00:00
State: open

I was wondering if `$.i18n.setLng` should affect client-server locale...

So if we take in consideration that @jamuhl accept the pull request where I pass `httpOnly : false` on the cookie.set then when we change the language using the `?setLng=` it will affect both client and server but I'm wondering if `$.i18n.setLng` should work in the same way... I mean should we set the cookie value when we use `$.i18n.setLng` ? What do you think? Currently in order to change language "transparently" I use something like this:

```js
$.get('/?setLng=el-GR', window.location.reload);
```

So the above do a simple thing, calls the root url with `?setLng=el-GR` the request is done by ajax so the cookie is set transparently, and we reload the page as a callback, the next time page reloads will have the new locale set in cookie in order to be used from both client and server.

I was wondering if this: `$.i18n.setLng('el-GR', window.location.reload);` should have similar effect with previous code.

Thanks