Author: dieppe
Date: 2008-04-30 09:44:44 +0000 (Wed, 30 Apr 2008)
New Revision: 19624

Modified:
   trunk/apps/thingamablog/src/net/sf/thingamablog/App.java
   trunk/apps/thingamablog/src/net/sf/thingamablog/TBGlobals.java
Log:
fix the FPROXY_PORT property import;
set the selected language to the system language if no language is 
already set in properties, and if it's available (otherwise, set to 
"en");



Modified: trunk/apps/thingamablog/src/net/sf/thingamablog/App.java
===================================================================
--- trunk/apps/thingamablog/src/net/sf/thingamablog/App.java    2008-04-29 
21:35:49 UTC (rev 19623)
+++ trunk/apps/thingamablog/src/net/sf/thingamablog/App.java    2008-04-30 
09:44:44 UTC (rev 19624)
@@ -23,6 +23,7 @@
 import java.awt.Toolkit;
 import java.io.File;
 import java.io.IOException;
+import java.util.Locale;
 import java.util.logging.FileHandler;
 import java.util.logging.Handler;
 import java.util.logging.Level;
@@ -85,8 +86,18 @@
         TBGlobals.loadProperties();

         //set up the I18n resource bundles
-        if(TBGlobals.getProperty("LANG_LOCALE") != null)
+        if(TBGlobals.getProperty("LANG_LOCALE") != null) {
                i18n.setLocale(TBGlobals.getProperty("LANG_LOCALE"));
+        } else {
+            String defaultLoc = Locale.getDefault().getLanguage();
+            String selected = "en";
+            Locale[] available = i18n.getAvailableLanguagePackLocales();
+            for (int i = 0; i < available.length; i++) {
+                if (defaultLoc.equals(available[i].getLanguage()))
+                    selected = defaultLoc;
+            }
+            i18n.setLocale(selected);
+        }

         //OSX properties
         System.setProperty("apple.laf.useScreenMenuBar", "true");

Modified: trunk/apps/thingamablog/src/net/sf/thingamablog/TBGlobals.java
===================================================================
--- trunk/apps/thingamablog/src/net/sf/thingamablog/TBGlobals.java      
2008-04-29 21:35:49 UTC (rev 19623)
+++ trunk/apps/thingamablog/src/net/sf/thingamablog/TBGlobals.java      
2008-04-30 09:44:44 UTC (rev 19624)
@@ -282,7 +282,7 @@
                             nodePort = props.getProperty("NODE_PORT");
                         if(props.get("NODE_HOSTNAME") != null)
                             nodeHostname = props.getProperty("NODE_HOSTNAME");
-                        if(props.get("FRPOXY_PORT") != null)
+                        if(props.get("FPROXY_PORT") != null)
                             fproxyPort = props.getProperty("FPROXY_PORT");
                }
                catch(FileNotFoundException fnfe)


Reply via email to