Hi, > Kent Olsson schrieb: > > For everyone who wants to localise the application. > > the example doesn't work using the current repository version.
I know. It was not my intention to have the automatic layout update ready now and it can be read between the lines, therefore I was asking a few questions below. After a response from the community, it might be possible to go on integrating it in a good way. Though, it works if you restart the application with another QxLocale, but that is of course a little more manual work! But for the community to know and respond it is better publishing it. > > There are some issues: > > 1. integration of the rendering machine > > When the locale has been changed, the rendering should take place again > > on demand. Therefore there must be some kind of integration, controlling > > the rendering queue. For example all widgets will reload their resources > > and re-render. > > 2. The other way, which is not smooth, but which does not need any > > integration, is to "restart" the application whenever the locale has > > been changed. > > 3. or maybe some other idea...a new method..integration. > > > > I think alternative 1 is the way to go, because different parts of the > > application can have a different locale. > > Yes I think the same. Alternative #1 is the best. > > > > > Where and how would you best like to integrate it Sebastian? > > I've currently no idea. I don't know why we need a special layout > handling. Each text which will be updating inside a QxLabel for example > should result in a rerendering automatically. This should already > (hopefully) work well. It is not about a special layout handling. We need to teach the widgets to repick the localisation strings because they are different for different locales. Additionally, the layout must adjust for locale differences in sizes etc. Today the following happens: 1. a line of code creating a widget class is run 2. information such as label texts etc is saved in local properties or variables 3. the class widget is layouted to the user With localisation: 1. a line of code creating a widget class is run 2. information such as label texts etc is saved indirectly in a reference, then the new string will be brought in every time at layout 3. the class widget is layouted to the user But if I understand it correctly, I think there must be a change of the layout mechanism, so we can layout through references instead of actual stored data in local variables or properties. Is that right? Kent > Sebastian > > > > > > > Kent > > > > > > ------------------------------------------------------------------------ > > > > Testing Locale implementation. > > > > The internationalisation is an important feature of a class library. > > > > > > ------------------------------------------------------------------------ > > > > The QxLocale class is intended for use to make localization possible for an > > application. The language, country and a variant can be et for multiple > > items at the same time with a default locale if necessary. > > > > Files > > ===== > > QxLocale.js The locale class. > > QxLocaleManager.js The manager class of the locale. > > QxResource.js The resource class. > > Definitions.js The class definitions not yet implemented in > > the Qooxdoo framework. > > Locale_1.html The example class. > > > > > > Class Relationship > > ================== > > The QxLocaleManager manages the current QxLocale for an application. The > > QxResource gets the localised data from files by the transport mechanism > > implemented. > > > > Usage > > ===== > > The class can be used in any application by adding the following two lines > > in your code. The Definitions.js file includes the setup of static as well > > as dynamic variable data for the class to be created, which has not yet > > been included in the Qooxdoo framework. > > > > <script type="text/javascript" > > src="qooxdoo/source/contributed/locale_olsson/Definitions.js"></script> > > <script type="text/javascript" > > src="qooxdoo/source/contributed/locale_olsson/QxLocale.js"></script> > > <script type="text/javascript" > > src="qooxdoo/source/contributed/locale_olsson/QxLocaleManager.js"></script> > > <script type="text/javascript" > > src="qooxdoo/source/contributed/locale_olsson/QxResource.js"></script> > > > > You have to change the path in relation to your own code. > > > > The Demo Class > > ============== > > Shows creation of a simple frame with a main menu bar, tool bar and a > > status bar. There is a menu alternative for changing the language of the > > frame. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
