Reload app?
littlefyr opened this issue · 3 comments
Hey,
This might be more of an example to put into the demo, but if you were build a Single Page App, then you would need the ability to change the language after the app is initialized.
The trivial approach is to set a cookie or local storage and then reload the page. But if the preference is stored in the user model (because you also send server generated notifications in the preferred language, perhaps) then you will get the language after everything is initialized. This is a normal usecase, I would think.
Reloading the page once you get a different language from the user (and using cookies et. al.) is a bad approach. There should be a better solution.
If it changes how you create your app, so be it, but that should be demonstrated at least.
Not sure I follow correctly here. I couldn't find out a better approach than updating the cookies/localstorage once the language value is set and reload the app. If you have any working idea, please share an example and we can discuss about pros/cons.
I have been digging into this for a while. But as usual, it is always nice to get a fresh view!
Thanks!
Max
Its starts with an answer to the question, "how do I load an new set of
properties after the app us running?"
The next one is "what do I need to do to have my app reload/refresh its
views?"
On 2014-10-26 2:27 PM, "Maximiliano Fierro" notifications@github.com
wrote:
Not sure I follow correctly here. I couldn't find out a better approach
than updating the cookies/localstorage once the language value is set and
reload the app. If you have any working idea, please share an example and
we can discuss about pros/cons.I have been digging into this for a while. But as usual, it is always nice
to get a fresh view!Thanks!
Max—
Reply to this email directly or view it on GitHub
#18 (comment)
.
There is a new example using ViewModels and ViewControllers in v1.1.0 to showcase how to change language on the fly. See https://github.com/elmasse/elmasse-bundle/tree/master/examples/demo-classic-vm