-
25 Nov 2010 5:03 PM #1
Ext.i18n.Bundle Using Bundles now for Sencha Touch 1.0
Ext.i18n.Bundle Using Bundles now for Sencha Touch 1.0
Guys,
Here you can find my solution for i18n using .properties files (ala Java) Hope you can find this useful!
http://elmasse.gaver.nl/index.php/bl...-touch-bundles
Regards!
Max
-
29 Jun 2011 5:34 AM #2
This is an interesting approach. I do something similar in the post below, the difference being I use js objects to store values instead of properties files:
http://www.sencha.com/forum/showthre...d-Localization
Eventually I would like to get a response from the Sencha Touch crew to see if they have an officially sanctioned way to do I18N. An API from them would be awesome ... but I haven't heard anything about that.
-
6 Jul 2011 10:31 AM #3
It seems that link is private.
I too would love for Sencha to offer an official path.Olivier - interfaSys
Developing custom solutions for BlackBerry 10 using Sencha Touch.
-
2 Aug 2011 11:41 PM #4
-
3 Aug 2011 5:21 AM #5
AFAIK, Sencha or ExtJS has a way to do i18n by loading .js files that override variables used to represent text.
This solution doesn't aim to replace that methodology but it comes to solve a common issue when you work with Java code in backend. At the time I started this component I was working with a lot of Java and I needed to re-use or integrate its i18n solution in order to not have multiple path to the same way.
Despite of that, I believe that we need a better strategy for i18n but that is a different topic.
-
3 Aug 2011 6:31 AM #6
Link content
Link content
Here is the content from the above link that does not work for non-premium members.
Hi,
My app has content that is being localized, and I am curious if there is a suggested approach for an I18N implementation. I have an idea about what could be done, but would like to know if I'm doing it all wrong.
Basically I need all the localized resources before the app is initialized, so they can be used as component configuration values. To do this, I do something like
To clarify, Localization is not an existing object. It is created in my code before my app is launched, and contains logic to get the correct strings based on browser locale. Then in the app I can do things like:Code:Localization.onReady(startApp())
I can use the global navigator object to detect browser locale and get the right strings that way, so no worries there.Code:var myButton = new Ext.Button({text: Localization.getLocalizedString('mybuttonresourcekey')});
Is this the right approach? I'm mostly questioning the way I use the Localization.onReady before Ext.onReady to start the app. Thanks for any advice you can lend, or documentation you can point me to.
Brien
-
3 Aug 2011 10:34 AM #7
Brien,
This is an oldie but it is how i18n is proposed from ExtJS devs point of view:
http://www.sencha.com/learn/legacy/Tutorial:Localizing_Ext
This is some kind of workaround. You can override your localized variables by js code. In this example, when you change or select a different language, a new .js file is loaded and its content will override your already defined variables.
-
12 Sep 2011 1:45 AM #8
Hello,
I'm struggling for a week now on internationalizing my application. I tried above hints and tips, but my situation is each time slightly different so it's difficult to find the correct solution.
I'm creating an application with Phonegap, so I can not make use of server things. Everything needs to be in Javascript.
I tried the Ext way of doing i18n, but the problem is that I can't find how to refresh the page so that it is using the new values. Should I destroy everything and load it again? In the beginning all my panels were created with ... = new ..., but I already changed that to classes to call the initComponent method. Creating all the panels again is a lot of work because I have a lot of panels.
I also tried it with a seperate object in which the strings are, but again, the strings are refreshed in this object but I can't find out how to refresh them in the panels.
Thanks already for your hints and tips. it already helped me a lot.
Jolien
-
12 Sep 2011 10:53 PM #9
Hi again,
I just tried to call the initComponent methods, and that is changing the values but it still doesn't refresh the rendered html. is there some kind of render method you can call manually?
-
13 Sep 2011 1:35 AM #10
Hi,
I got it working by destroying my viewport and creating it again. This loads all the panels again with the correct language and renders them again. It happens without flickering for the user.
Similar Threads
-
i18n with Ext.js: Resource Bundles!
By elmasse in forum Community DiscussionReplies: 29Last Post: 25 Jan 2013, 2:21 PM -
Ext JS and Sencha Touch!
By mcamer in forum Sencha Touch 1.x: DiscussionReplies: 8Last Post: 1 Dec 2010, 10:19 AM -
[FIXED-598] Getting Started has ext-touch-debug.js instead of sencha-touch-debug.js
By scottpenrose in forum Sencha Touch 1.x: BugsReplies: 2Last Post: 26 Nov 2010, 9:58 AM



Reply With Quote
