-
Ux.locale.Manager
Need to handle dynamic locale? Want to load locale via Ajax? Want locale to be applied without rerendering components? If so, Ux.locale.Manager may suit your needs.
This manager does not support all components but examples have been provided to support other subclasses of Ext.Component (Sencha Touch or custom component).
This manager also works with Ext JS 4, one class to rule them all!
Sencha Market Listing: http://market.sencha.com/addon/ux.locale.manager
GitHub repo: https://github.com/mitchellsimoens/Ux.locale.Manager
-
I will be supporting JsonP in the next release.
This does not use bundles, no need for them really.
-
Thank you mitchellsimoens; exactly what I was looking for !
-
1 Attachment(s)
I've slightly modified Ux.locale.override.st.Container to allow specifying a title on a non tabbed container.
The patch is attached.
I've also submitted a pull request on GitHub.
-
@mitchellsimoens,
Any ideas on how to get this working for an Ext.MessageBox ?
Since they are created on the fly, the setLocale function isn't called by the manager.
Thank you.
-
The buttons are already created and MessageBox should be picked up if you put a setLocale method so you would have to dig down to the buttons to change them.
-
That language switch is working smooth so far, thanks for providing.
What do i have to be aware of when doing a productive build?
Just copying the Ux & locales folder into the build/production doesn't seem to do the trick :)
In app. js I added:
Code:
Ext.Loader.setPath({
'Ext': 'sdk/src',
'Ux' : 'Ux'
});
The error console of the production app says only this with a blank app screen:
Code:
index.html:65Error evaluating file:///Users/macbook/myapp/build/production/app.js with message: SyntaxError: Unexpected token ':'
However, if i build the app without the "Ux" : "Ux" loader config, the app loads fine, just without any Ux support and this error console message:
Code:
TypeError: 'null' is not an object (evaluating 'a.title')
thanks for any hints...
-
All you should have to do is create the path and then require it via Ext.require. When you do a build it should see this require and include it in the build.
-
hmmm,
you mean in the app.js under ext.define in the requires: ([]) section? well, i already did that, but no luck.
do i have to include all the classes of ux.locale or just ux.locale.Manager?
the Ux folder is in the index.html root directory. So there should not be a need to specify its path, should it?
thanks heaps & happy easter bunnies
-
Look at the example. It sets a path and uses Ext.require to require the classes.