🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #175

[resolved]Re: i18n in swing, trouble

#175
From: 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.
Technical Details
Message-ID: <448d1e21$0$22866$626a54ce@news.free.fr>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!proxad.net!cleanfeed2-b.proxad.net!nnrp10-2.free.fr!not-for-mail
References: <448cf85c$0$9015$626a54ce@news.free.fr>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,93776c528b5065cc
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!proxad.net!cleanfeed2-b.proxad.net!nnrp10-2.free.fr!not-for-mail
Date: Mon, 12 Jun 2006 16:56:18 +0900
From: Schlum <news@schlum.info>
User-Agent: Thunderbird 1.5.0.4 (Windows/20060516)
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing
Subject: [resolved]Re: i18n in swing, trouble
References: <448cf85c$0$9015$626a54ce@news.free.fr>
In-Reply-To: <448cf85c$0$9015$626a54ce@news.free.fr>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 30
Message-ID: <448d1e21$0$22866$626a54ce@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 12 Jun 2006 09:56:17 MEST
NNTP-Posting-Host: 222.1.103.254
X-Trace: 1150098977 nnrp10-2.free.fr 22866 222.1.103.254:1557
X-Complaints-To: abuse@proxad.net