[Schmitzm-commits] r20 - trunk/src/skrueger/i8n

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Mar 4 18:32:18 CET 2009


Author: alfonx
Date: 2009-03-04 18:31:50 +0100 (Wed, 04 Mar 2009)
New Revision: 20

Modified:
   trunk/src/skrueger/i8n/Translation.java
Log:
skrueger.i8n.Translation is setting the Locale, we added:

		/**
		 * Setting default locale for Swing JComponents to work around bug 
		 * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4884480
		 */
		JComponent.setDefaultLocale(newLocale);

Modified: trunk/src/skrueger/i8n/Translation.java
===================================================================
--- trunk/src/skrueger/i8n/Translation.java	2009-03-02 18:35:18 UTC (rev 19)
+++ trunk/src/skrueger/i8n/Translation.java	2009-03-04 17:31:50 UTC (rev 20)
@@ -3,6 +3,11 @@
 import java.util.List;
 import java.util.Locale;
 
+import javax.swing.JColorChooser;
+import javax.swing.JComponent;
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+
 import org.apache.log4j.Logger;
 
 /**
@@ -48,7 +53,15 @@
 			throw new IllegalArgumentException("'"+activeLang+"' is not a valid ISO language code.");
 		}
 
-		Locale.setDefault(new Locale(activeLang));
+		Locale newLocale = new Locale(activeLang);
+		Locale.setDefault(newLocale);
+		
+		/**
+		 * Setting default locale for Swing JComponents to work around bug 
+		 * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4884480
+		 */
+		JComponent.setDefaultLocale(newLocale);
+		
 		Translation.activeLang = activeLang;
 		log.info("Translation-system switched to "+activeLang);
 	}



More information about the Schmitzm-commits mailing list