Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Locale change and JFaceResources
Locale change and JFaceResources [message #1833763] Fri, 23 October 2020 12:43 Go to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 34
Registered: August 2011
Member
Hi,

we have a RCP Application based on Eclipse Mars.1 and we are in the process of supporting multiple languages.

We use the "new eclipse localization" described by Dirk Fauth and Tom Schindl here http://blog.vogella.com/2013/05/22/eclipse-internationalization-part-24-new-message-extension-by-dirk-fauth-and-tom-schindl/

Before the Workbench shows up we use a Splash Screen to provide a login form. After Login we switch the Application language to the preffered language of the user, which can be different from the system language.
In order to get that working we are starting our product with
-Declipse.registry.MultiLanguage=true


We do the locale switch with something like
Locale.setDefault(userLocale);
IEclipseContext context.set(TranslationService.LOCALE, userLocale);


Overall this works as expected (Views and Editors are in english etc. ), but e.g. in the about Dialog (and probably in other parts of Eclipse) the Buttons "Installation Details" are still in the system language (german in my case) and not in the user language.

Root cause from my point of view is the class JFaceResources where the translations are obtained by
public static String getString(String key) {

which get's them from a static ResourceBundle which get's initialized very early
/**
	 * The JFace resource bundle; eagerly initialized.
	 */
	private static final ResourceBundle bundle = ResourceBundle
			.getBundle("org.eclipse.jface.messages"); //$NON-NLS-1$


Is there anything I've missed or I can do to get these JFace Strings also in the correct language?
Is this somehow changed/fixed in newer Eclipse versions?

Thanks for any hints!

Best Regards,
Peter



Re: Locale change and JFaceResources [message #1834180 is a reply to message #1833763] Wed, 04 November 2020 11:33 Go to previous messageGo to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 34
Registered: August 2011
Member
Should I raise a bug for this?

Bye Peter
Re: Locale change and JFaceResources [message #1837006 is a reply to message #1834180] Wed, 20 January 2021 20:34 Go to previous message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 463
Registered: July 2009
Senior Member

Hi Peter,

The language switch you use will only work for your application. Eclipse itself does not use it. For anything coming from Eclipse (about, p2, marketplace, etc..) you have to include the language packs for each language you support.



Cheers,

Wim
Previous Topic:How to connect OSGI with SQL server on Eclipse
Next Topic:SSL error when adding Remote Liberty server
Goto Forum:
  


Current Time: Thu Jan 21 12:48:22 GMT 2021

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

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

Back to the top