NL (Dutch) language in Swing doesn't seem to work

I have a Java application that supports multiple languages. When I change the language (in the settings dialog), the language of the entire application changes, including the language of the Swing components, such as JFileChooser . This is great for English, Spanish and French. But when I choose Dutch, the language of the Swing components ( JFileChooser , confirmation dialogs, etc.) changes to English.

Below is the code that changes the language to Dutch. Note: for other languages ​​I use the same code (except for the string "NL" , of course), and it works fine.

 Locale locale = new Locale("nl"); Locale.setDefault(locale); JComponent.setDefaultLocale(locale); 

I also tried to create a locale using new Locale("nl", "BE"); and new Locale("nl", "NL"); but none of them worked. Is there a problem with the Dutch language? Or am I doing something wrong here?

+4
source share
2 answers

As stated here, Dutch is not supported for user interfaces. Translations:

Translating the Java SE user interface Runtime Environment The user interface elements provided by the Java SE runtime environment 6 include Swing dialogs, messages written by the runtime on standard output and standard error streams, and messages created by the tools provided by the JRE. These user interface elements are localized in the following languages:

Language identifier Chinese (simplified) zh_CN
Chinese (Traditional) zh_TW
English en
French fr
German de
Italian it
Japanese ja
Korean ko
Portuguese (Brazilian) pt_BR
Spanish es
Swedish sv

+7
source

A few years to the end ... But you can also create a wrapper class like this

 public class DutchLocale { static public final Locale NL = new Locale("nl", "NL"); } 
0
source

All Articles