How to test Localization without Rebooting

J

Jim Cobban

I am putting localization features into my application: for example using a
ResourceBundle to customize output strings. Everything is driven by the
current default Locale. Is there some way external to the program to set
the default Locale. At the moment the only way I know is to set the country
and language through the Windows Control Panel and reboot. Do I need to add
a feature to my program to permit the user to explicitly set the Locale?

--
Jim Cobban (e-mail address removed)
34 Palomino Dr.
Kanata, ON, CANADA
K2M 1M1
+1-613-592-9438
 
T

Tor Iver Wilhelmsen

Jim Cobban said:
I am putting localization features into my application: for example
using a ResourceBundle to customize output strings. Everything is
driven by the current default Locale. Is there some way external to
the program to set the default Locale.

Have you tried Locale.setDefault()? Just asking is all. Run your app
"wrapped" in an app that sets Locale as needed.
 
R

Real Gagnon

I am putting localization features into my application: for example
using a ResourceBundle to customize output strings. Everything is
driven by the current default Locale. Is there some way external to
the program to set the default Locale. At the moment the only way I
know is to set the country and language through the Windows Control
Panel and reboot. Do I need to add a feature to my program to permit
the user to explicitly set the Locale?

Change the user.language and user.region properties :

java -Duser.language=en -Duser.region=US MyApplication

Bye.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top