We use Cordova to make a native app from Sencha Touch, and at present I have run into a problem.
The application in question is localised to 26 different european markets. In the JS we use localised copy in the config objects of our views for readability and easy developing.
E.G
Ext.define('MyApp.view.Main', {
extend: 'Ext.Panel',
xtype: 'main',
config: {
title: MyApp.utils.Strings.getString('mainTitle')
}
});
So the problem we are now having is with using the globalization plugin in Cordova. https://github.com/apache/cordova-plugin-globalization/blob/master/doc/index.md
The globalization method for getting the device language (we need to be as specific as French Belgium and so forth) is an async call. So by the time the result is received the Sencha JS has already been parsed and all the strings are returned as "undefined" as there was no locale code set when the config objects tried to obtain the copy.
What I was trying to do is delay Sencha running until I have gained the iso-code from Cordova so when the Sencha app loads and boots up it is has all the information needed.
I have tried changing the production.js microloader and the testing.js. However if I change this loaders so I can call the start of Sencha myself it all goes a bit crazy and app.js deletes the entire body and never works.
The question is. Is there a way to delay the start of Sencha and the app.js being loaded? Or is there a way to do what I want to do above without fundamentally changing my entire app.
Any recommendations welcome.