|SWT buttons internationalization [message #656698]
||Mon, 28 February 2011 08:07
| Viorel Hojda
Registered: July 2009
Hello all !|
I've been working on internationalization of an RCP Product. Basically I used fragment plugins and resource files for each Locale/language I want my program to be in. So far everything works fine. The problem is this: how to internationalize SWT buttons like "Yes", "No","Cancel", etc ? Let's say I make a MessageBox with the following code:
MessageBox mb = new MessageBox(Display.getCurrent().getActiveShell(),
SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL);
Now, let's say I want to start in app in french. I start the app with the "-nl fr" arguments and in my plugins directory I have all the plugins that I need (that is org.eclipse.swt.nl_fr_3.6.0.v20101211043401.jar). All the app is ok, some internal messages (file menus, etc) and the messages from the resource files are in french, except the "Yes"/"No"/"Cancel" buttons. I want to specifiy that in the org.eclipse.swt.nl_fr_3.6.0.v20101211043401.jar i did found a resouce file SWTMessages_fr.properties with the following values (among others):
So, I think the buttons should be fine, but they aren't. Also, I've tried to change the Locale on the OS in french, but still nothing. If anyone can help me, I would much appreciate it.
Thank you !
|Re: SWT buttons internationalization [message #657687 is a reply to message #657682]
||Thu, 03 March 2011 16:12
| Thomas Schindl
Registered: July 2009
Well does your answer mean I can't start an application in EN_US if my|
operating system is DE_AT?
For the rest of Eclipse I can certainly do this quite easily by starting
with -nl EN_US.
Am 03.03.11 16:57, schrieb Grant Gayed:
> SWT's MessageBox implementation does not provide the strings that are
> displayed on its buttons, these come solely from the OS. So if you're using
> an OS install whose language is XXX then the buttons should automatically
> reflect this. I'm not sure why you aren't seeing this when you try to
> change your machine's locale. When you make this change do the strings in
> other apps change? (eg.- run Notepad, go to save a new file, are the native
> file dialog's strings like "Save as type:" changed to your specified
> "Viorel Hojda" <email@example.com> wrote in message
>> First of all, thanks a lot for the reply.
>> Unfortunately, I doesn't work. I already tried the solution you provided
>> before asking on the forum. Everything is in French except the buttons. My
>> "not so perfect" solution was to completely replace all the SWT
>> "MessageBox"-es with JFace "MessageDialog"-s. The buttons look ok using
>> JFace, but I would really like to be able to use SWT MessageBox -es, just
>> to know that I can and how to do it.
>> Thanks again, anyway.
Powered by FUDForum
. Page generated in 0.01546 seconds