Testing Java applications in different locales

I have a product that I built in the USA. A friend in Poland tested it today, and localized number formatting created some exceptions.

I would like to simulate the launch of my program in Poland or Germany, so that I can recreate these errors before correcting them. I thought it was as simple as installing Locale, but every attempt seems to have no effect. I called Locale.setDefault and passed in -Duser.language = de_DE as VM args. But the numbers are always formatted in US format (i.e. 1000.00). But my friend downloads the application, and he sees 1.000.0.

Does anyone know how I can test my Java application in Germany or Poland so that I can see this default formatting?

+5
source share
1 answer

I usually set local information via control panel -> region and language (note that this is on Windows ).

Or if you want to install it using JVM arguments, I think it should be something like this.

 -Duser.language=de -Duser.country=DE 

You can check here for more information.

+2
source

Source: https://habr.com/ru/post/1233829/


All Articles