In Swing, if I want to set the default locale used by components, I can call JComponent.setDefaultLocale(). I want to do the same thing in SWT/JFace, so my JFace dialogs use a locale of my choosing to display the OK/Cancel buttons, etc. Is there an equivalent method in the SWT/JFace API that I can call?
I am aware that I could call Locale.setDefault(), but I would like to avoid this because there are other parts of the application where I need this to be the system default locale, instead of the locale of my choosing.
From what I've seen in the source code - especially where the values of IDialogConstants.OK_LABEL and similar constants originate - JFace completely relies on the default locale (Locale.getDefault()). Using SWT directly, e.g. org.eclipse.swt.widgets.MessageBox, will even ignore the Java default locale and display the dialog in the system's locale. So there seem's to be no SWT/JFace equivalent of JComponent.setDefaultLocale().
as far as I know you should be able to use the locale of your choice using :
Please check to download the correct swt-nl pack for your needs , different are available ...
HTH jerome
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With