🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.swing
2 messages
2 total messages Started by Schlum Mon, 12 Jun 2006 05:15
i18n in swing, trouble
#174
Author: Schlum
Date: Mon, 12 Jun 2006 05:15
20 lines
1768 bytes
Hi,

I am building my first Gui with Swing, and in the same time I need to 
use the i18n to make it work in Japanese and English.

I use Eclipse and its great Visual Editor to save time, all my files are 
utf8 encoded. And, I am under WinXp...

My trouble is the following :
-> If I make a jMenu with some japanese hardcoded text, it appears fine 
in my application.
-> If I use a ResourceBundle to get the text, I have garbage. I use the 
following line: myMenu.setText(myBundleResource.getString("myTest"));
The .properties files for the japanese is also in Utf8

Do you have any idea why the text in the .properties file is not passed 
correctly ? Any help would be really appreciated.

Best Regards,
Schlum
[resolved]Re: i18n in swing, trouble
#175
Author: Schlum
Date: Mon, 12 Jun 2006 07:56
29 lines
2152 bytes
Schlum wrote:
> Hi,
> 
> I am building my first Gui with Swing, and in the same time I need to 
> use the i18n to make it work in Japanese and English.
> 
> I use Eclipse and its great Visual Editor to save time, all my files are 
> utf8 encoded. And, I am under WinXp...
> 
> My trouble is the following :
> -> If I make a jMenu with some japanese hardcoded text, it appears fine 
> in my application.
> -> If I use a ResourceBundle to get the text, I have garbage. I use the 
> following line: myMenu.setText(myBundleResource.getString("myTest"));
> The .properties files for the japanese is also in Utf8
> 
> Do you have any idea why the text in the .properties file is not passed 
> correctly ? Any help would be really appreciated.
> 
> Best Regards,
> Schlum
For the record:

The .properties needs to be in ASCII/Latin-1 with any non ASCII/Latin-1 
char encoded with the \u notation, not in utf8

This is difficult to write by hand, so use native2ascii to convert your 
text. I would recommend to add the call to native2ascii to your build 
system.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads