I am testing language settings with an application running on Java 8. Specifically I am interested in locale settings.

Currently a test for Spanish is required. Since I use Windows 10 I did the following:

  • Under Control Panel > Region I set all settings to Spanish, including the system configuration, without checking the box to use UTF-8 encode for compatibility
  • In Win10 settings I set the UI language to Spanish and signed out, then signed back, so that my Win10 UI is now in Spanish.
  • The region in those same settings is also set to Spanish
  • The keyboard layout, that can be selected in the task bar, is also set to ESP.
  • After doing all that I also restarted my system.

Everything that I was able to find via non-registry system configuration is now set to Spanish. Yet the Java call Locale.getDefault().getLanguage() reliably continues to deliver en.

Where does it get that from? Do I have to read system properties to retieve the information, that my system runs in fact in Spanish? What is Locale.getDefault() even for then?

0 Answers