Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » Strategy for I18N(how to internationalize the code generated with WB)
Strategy for I18N [message #815710] Thu, 08 March 2012 00:47 Go to next message
Shaohua Ma is currently offline Shaohua MaFriend
Messages: 4
Registered: March 2012
Junior Member
what's the best way to internationalize the code generated with WB, yet not inhibit the capability of using the visual editor?

for example, if i create a label "Name", the code generated by WB will have a line like this:
JLabel nameLabel = new JLabel("User Name:");

Now I want to I18N it. I will create a key for the info:
static String NAME_KEY = "NAME_KEY";

and i will have code for retrieving the proper text based on the key. but how do i put the retrieved text back into the code, without impact on the visual editing capability?

I am thinking of a post init process as a solution. but I'd like to here some advice first.
Re: Strategy for I18N [message #815740 is a reply to message #815710] Thu, 08 March 2012 01:39 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
Registered: July 2009
Location: Boston, MA
Senior Member
Have you tried reading the "Internationalization (i18n) / Localization" section of the WB docs?
Re: Strategy for I18N [message #816197 is a reply to message #815740] Thu, 08 March 2012 14:41 Go to previous messageGo to next message
Shaohua Ma is currently offline Shaohua MaFriend
Messages: 4
Registered: March 2012
Junior Member
Not really.
I've just checked, and found a section within the "features" heading. looks promising. Will go through it and see how that works.
Thanks a lot.

sma
Re: Strategy for I18N [message #816381 is a reply to message #816197] Thu, 08 March 2012 19:41 Go to previous messageGo to next message
Shaohua Ma is currently offline Shaohua MaFriend
Messages: 4
Registered: March 2012
Junior Member
Ok. I tried the feature and it works. Now I have a different question.

My codebase has this weird structure for i18n:
/src
/i18n

the i18n folder contains all the message.properties files. for compatibility reason, I need to use this structure. the issue now is that, with WB, it can only see the /src folder as its source. Is there any way to enable the WB to see more? By the way, as you might have already guessed it, the /i18n is on the class path. it's just not visible to WB.

your help is very much appreciated.

sma
Re: Strategy for I18N [message #817694 is a reply to message #816381] Sat, 10 March 2012 13:45 Go to previous message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
Registered: July 2009
Senior Member
This works for me.
If it does not work for you - test case could be helpful.


Konstantin Scheglov,
Google, Inc.
Previous Topic:Windowbuilder I18N-additional source folder
Next Topic:ThemePainter ClassCastException Office2003Painter Jide
Goto Forum:
  


Current Time: Thu Mar 28 20:11:14 GMT 2024

Powered by FUDForum. Page generated in 0.04305 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top