Localization of JFace MessageDialog [message #1580382] |
Fri, 23 January 2015 13:08 |
Heiko Hollenbach Messages: 5 Registered: December 2014 |
Junior Member |
|
|
Hi,
I'm trying to translate the buttons of a JFace MessageDialog. In English they are shown with "OK" and "Cancel". But in German they still are shown with "OK" and "Cancel".
I created the RAP Hello World example.
Added this to
BasicEntryPoint#createContents
MessageDialog.openConfirm(button.getShell(), "Title", "Buttons should be translated");
BasicApplication
public void configure(Application application ) {
...
application.setOperationMode( OperationMode.SWT_COMPATIBILITY );
}
Copied the messages.properties from the org.eclipse.rap.jface... plugin to my plugin under src.org.eclipse.jface and renamed it to messages_de.properties. And did change the strings to
build.properties looks like
bin.includes = META-INF/,\
OSGI-INF/,\
.,\
src/org/eclipse/jface/messages_de.properties
PS:
RWT.getLocale() is de_DE
The Cancel Button still has the text "Cancel". What am i missing?
[Updated on: Fri, 23 January 2015 13:23] Report message to a moderator
|
|
|
Re: Localization of JFace MessageDialog [message #1580407 is a reply to message #1580382] |
Fri, 23 January 2015 13:28 |
|
First of all, the Eclipse Babel project [1] provides community-managed language packs for various languages, and I invested some time to add the necessary German translations for RAP bundles. You can download the language packs from their website [2].
Depending on your build and runtime enviroment you'll need to update your target definition and make sure that the required fragments with the translations are part of your launch configuration.
Fragments? Bundles? I think here's the error in your setup. If I understand you correctly you were copying property files into your own bundle and translated them there. Unfortunately this is not how Eclipse searches for translations. You'll need to create a fragment that has the corresponding RAP bundle as host and put the language specific property files into this fragment.
But... as I wrote above... the easiest solution is to use the already available language packs from Babel.
[1] http://eclipse.org/babel/
[2] http://eclipse.org/babel/downloads.php
Regards,
Markus
--
Twitter: @mknauer23 and @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02468 seconds