Reading the Locale class I thought of this hypothetical problem.
"I am writing a program for use in both the UK head office and German branch office. We have a UK run and a separate German run on the same UK JVM. The reports include country name. Reports from the UK run should print "Germany" , reports from the German run should print "Deutchland".
A command line arg UK or DE indicates the run type (default UK).
If DE then setDefault to Deutchland then reset at EOJ to UK might work.
But what about concurrently running jobs ? How long does setDefault last , if I do not reset it (program abends) ?
Can the "variant"
string be used to solve this problem ie. set it to "Deutchland" ? How is it set - no setVariant()."
I notice S&B page 468 (System.out.println where appropriate) :
Locale locBR = new Locale ("pt" , "BR") ;
locBR .getDisplayCountry() ; // Brazil
locBR .getDisplayCountry(locBR) ; // Brasil
Finally, just what is this all about ?
Locale currentLocale = Locale.getDefault(); // en_GB
currentLocale = new Locale( "en_GB" ); // en_gb
currentLocale = new Locale( "en" , "UK" ); // en_UK
currentLocale = Locale.UK ; // en_GB
Thank you