Search code examples
localizationrefreshsencha-touch-2tabpanel

How to refresh a app without quitting to apply localization in Sencha Touch 2


When the use selects a different language in a settings screen, I want the app to re-launch so that the navigation and the content is refreshed-reloaded. I currently am forcing this by handling the show method on each class which is not ideal and highly repetitive. This approach does not work for refreshing the tab panel which is always present and there is no event where I can trigger a reload of its content (at least not that I understand).

Ideally I would like the entire app to reload once the user selects a different language and be in a state as if after initial launch. Is there an easy way to accomplish this?


Solution

  • What's worked for me has been:

    window.location.reload();
    

    It'll reload the entire app without the user having to relaunch the app from the home screen. Assuming you're working in a webview, all of the window commands work as they would in the browser.