Java: Get current language / locale

String local = Locale.getDefault().toString();
System.out.println(local);

Outputs for example “en” or “de”.

Or

String locale = System.getProperty("user.language");
System.out.println("The Locale of the system is: "+locale);

Example output: The Locale of the system is: de

Werbung



comments powered by Disqus

Copyright Dunkel & Iwer GbR | Datenschutzerklärung | Impressum