Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test Java Application in Different Locale

I have a product I built in the US. A friend in Poland was testing it today and the localized number formatting created some exceptions.

I would like to simulate running my program in Poland or Germany so that I can recreate those errors before I fix them. I thought it was as simple as setting the Locale, but every attempt seems to have no effect. I have called Locale.setDefault, and passed in -Duser.language=de_DE as VM args. But the numbers are always formatted in the US format (i.e. 1,000.00). But my friend loads the app and he see's 1.000,0.

Does anyone know how I can test my java application in Germany or Poland locale so I can see this formatting by default?

like image 417
Dustin Avatar asked Oct 16 '15 03:10

Dustin


Video Answer


1 Answers

Usually, I set the locale information through control panel -> region and language (note that this is on Windows).

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

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

you can check here for more information.

like image 182
kucing_terbang Avatar answered Sep 27 '22 00:09

kucing_terbang