I use ember-i18n for translating my app, but how can I change namespace, when user switches a language, cause i have two different api for each language.
In app/route.js, i do
this.store.adapterFor('application').set('namespace',api/rest/${apiLangPath[this.get('i18n.locale')]}/);,
when i observe property service i18n.locale and then this.refresh(), cause my app reload for a new api namespace. But, it’s not working.
How are you loading your models from your API? I’d read carefully the documentation on store.findAll – depending on your settings, it may not query the back-end API again after the first time; it’ll just return the objects already in the store.
I would suggest injecting your i18n service into your adapter and then reading the language property in overrides there. Adjusting your adapter from your route isn’t likely to work nicely …