Test Java Application in Different Locale
Asked Answered
K

1

6

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?

Kyat answered 16/10, 2015 at 3:16 Comment(1)
Can you please let us know more about your app's tech stack ? Is it a web app, desktop or mobile app ? A random thought - Did you try just with -Duser.language=de ?Jornada
B
3

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.

Bifurcate answered 16/10, 2015 at 4:1 Comment(1)
Bah - that did it. Thanks. Don't know where I got that other setting from.Kyat

© 2022 - 2024 — McMap. All rights reserved.