[jsword-svn] r1217 - trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Mon Dec 18 19:23:09 MST 2006


Author: dmsmith
Date: 2006-12-18 19:23:09 -0700 (Mon, 18 Dec 2006)
New Revision: 1217

Modified:
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java
Log:
User user.language system property to influence program's language

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java	2006-12-19 01:46:10 UTC (rev 1216)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java	2006-12-19 02:23:09 UTC (rev 1217)
@@ -143,6 +143,30 @@
         // ResourceBundles, properties and other resources
         Project project = Project.instance();
 
+        // Allow the setting of user.language and user.country to influence the default locale
+        String language = System.getProperty("user.language"); //$NON-NLS-1$
+        String locale = null;
+        if (language != null)
+        {
+            locale = language;
+        }
+
+//        LATER(DMS): support country based locales
+//        String country = System.getProperty("user.country"); //$NON-NLS-1$
+//        if (country != null)
+//        {
+//            if (locale != null)
+//            {
+//                locale += '_';
+//            }
+//            locale += country;
+//        }
+
+        if (locale != null && ! "en".equals(locale)) //$NON-NLS-1$
+        {
+            Locale.setDefault(new Locale(locale));
+        }
+
         // Load the configuration.
         // This has to be done before any gui components are created.
         // (Including the splash)




More information about the jsword-svn mailing list