Re: i18n with swixml

Wolf Paulus <[email protected]>
Newsgroups gmane.comp.embedded.carlsbad-cubes
Message-ID <[email protected]>
Actually, much thought went into the internationalization capabilities 
of Swixml.
Swixml's SwingEngine can be reconfigured - the locale can be changed - 
at runtime. However, if Strings, Labels etc. have been rendered 
already, you need to re-render the UI. (See SwingEngine.getLocalizer() 
etc)

In one of the internationalized apps I work with user profiles.
The user get presented a Login screen, using the server's default 
locale.
After login, the Swixml based client app pulls the user profile from a 
database and changes to the locale stored in the profile.

There is also a simple example available here:
http://www.swixml.org/samples/index.html (#5)


On Feb 4, 2004, at 11:57 PM, patt reveur wrote:

> Hello
>
> This is my first contribution tu this mailing liste but i would like 
> to give my opinion on your remark Frank.
>
> I use swixml for a while now and I am very happy with it.
>
> But about internationalization, you should know that many countries 
> like Belgium, EAU and others use more than one signle language and are 
> happy to switch from one to the other in a single click.
>
> This is really a major point in a product competition in those 
> countries.
>
> So. please, do not be so strict on the use of the Locale. This set of 
> Classes are very importante.
>
> Regards
> patt
>
>
>
> ----Original Message Follows----
> From: Frank Meißner <[email protected]>
> Reply-To: List for Users of Carlsbad Cubes' Technologies and 
> Products<[email protected]>
> To: List for Users of Carlsbad Cubes' Technologies and 
> Products<[email protected]>
> Subject: Re: [Forum] i18n with swixml
> Date: Thu, 05 Feb 2004 08:24:01 +0100
>
> Kovács Lajos wrote:
>>   Hello everybody!
>>
>>  I started to use the swixml and it seems to be a very powerfull tool.
>> Congratulation!
>>
>>  I have a question about the internationalization (i18n) technique 
>> with
>> swixml. I see that there are two custom tags, "bundle" and "locale" 
>> for
>> this reason. Unfortunately not woking as I expected.
>>
>>  I want to change online the strings on the GUI according to the 
>> selected
>> Locale (ex. selecting from a combobox). I made a resource bundle and 
>> I put
>> it as an attribute for the root tag. For the other tags (ex. button) 
>> for
>> the text I use only the keys from the bundle's property files. This is
>> working well, the buttons shows the local texts.
>>
>>   1) But how can I change it after the parsing? I can made in the 
>> code again
>> the resource bundle and set for all the texts but this is wrong. 
>> Exist a
>> way to reach or change the resource bundle made by the parser and 
>> only make
>> a refresh for the GUI.
>
> Hello,
>
> IMHO the only option you have is to render the GUI again. I did not do 
> this in practice, though. The way swixml handles the locale issue is 
> to respect the locale coming from the system at program startup. This 
> is fine and IMHO fits the normal usage of a program. Sure it is a cool 
> thing to change the locale in your program and everything (dates, 
> numbers, scrollbars, ...) will suddenly change. But this is not a 
> customer cares for... Correct me if I'm wrong...
>
>>
>>   2) The components doesn't inherit the Local setting from the root 
>> tag, so
>> all the texts will be arabic, for example, but the scrollpane doesn't 
>> shows
>> the scroll bar in the left side. For this need to specially add a 
>> Locale
>> attribute to the scrollbar. But in this way, you need to specify the 
>> Local
>> many places in the XML file, instead of one place the root tag.
>>   It would be a good approach to use for all the tags the main (root 
>> tag's)
>> Local, if no one is specified.
>
> There is no inheritance in respect to the locale. The way I would 
> solve this requires adding a property change listener to your root 
> component. This has to be a subclass of JComponent (which it usually 
> is) so you have the method addPropertyChangeSupport(String, 
> PropertyChangeListener)
> This method you call with the string "Locale" and a 
> PropertyChangeListener which does in its propertyChange method the 
> following: Foreach component of rootComponent.getComponents() set the 
> locale according to the one the user selected. If the component you 
> set the locale for happens to be a container as well, iterate through 
> its subcomponents as well.
>
>
>>
>>  Has anybody some ideea, how can I resolve this problems?
>
> Hope this gave you some ideas ;)
>
> Frank
>>
>>  Best Regards,
>>  Lajos
>>
>>
>>
>>
>> _______________________________________________
>> Forum mailing list
>> [email protected]
>> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
>>
>
>
> --
> AuthentiDate International AG
> Großenbaumer Weg 6
> 40472 Düsseldorf / Germany
> Phone   : +49(0)211 43 69 89-0
> FAX     : +49(0)211 43 69 89-19
>
> IT Sicherheit in Chemie-
> und Pharma-Unternehmen
> 25. Nov. 2003, Düsseldorf
>
> Erfahren Sie mehr unter:
> www.authentidate.de
>
>
> _______________________________________________
> Forum mailing list
> [email protected]
> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
>
> _________________________________________________________________
> MSN Messenger  http://g.msn.fr/FR1001/866 : un logiciel gratuit pour 
> dialoguer avec vos amis !
>
>
> _______________________________________________
> Forum mailing list
> [email protected]
> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
>
	Wolf Paulus

C a r l s b a d   C u b e s
mailto:[email protected]

CONFIDENTIALITY NOTICE:
This message is intended only for the use of the individual or entity 
to which it is addressed, and may contain information that is 
privileged, confidential and exempt from disclosure under applicable 
law.
If you are not the intended recipient, please contact the sender by 
reply email and destroy all copies of the original message.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.