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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jul 3 16:40:11 CEST 2009


Author: alfonx
Date: 2009-07-03 16:40:10 +0200 (Fri, 03 Jul 2009)
New Revision: 186

Modified:
   trunk/src/skrueger/i8n/Translation.java
Log:


Modified: trunk/src/skrueger/i8n/Translation.java
===================================================================
--- trunk/src/skrueger/i8n/Translation.java	2009-07-03 14:36:08 UTC (rev 185)
+++ trunk/src/skrueger/i8n/Translation.java	2009-07-03 14:40:10 UTC (rev 186)
@@ -58,12 +58,27 @@
 	/**
 	 * Set up the {@link Translation}-system to use language. If a change is
 	 * performed, events are fired to listeners. Nothing is done if the new
+	 * language equals the old language. The system's default locale is changed.
+	 * 
+	 * @param newLang
+	 *            The ISO Code of the new active language
+	 */
+	public static void setActiveLang(String newLang) {
+		setActiveLang(newLang, true);
+	}
+
+	/**
+	 * Set up the {@link Translation}-system to use language. If a change is
+	 * performed, events are fired to listeners. Nothing is done if the new
 	 * language equals the old language.
 	 * 
 	 * @param newLang
 	 *            The ISO Code of the new active language
+	 * 
+	 * @param setDefaultLocale
+	 *            Shall the system's default locale be changed?
 	 */
-	public static void setActiveLang(String newLang) {
+	public static void setActiveLang(String newLang, boolean setDefaultLocale) {
 		if (getActiveLang().equals(newLang)) {
 			return;
 		}
@@ -74,7 +89,8 @@
 		}
 
 		Locale newLocale = new Locale(newLang);
-		Locale.setDefault(newLocale);
+		if (setDefaultLocale)
+			Locale.setDefault(newLocale);
 
 		/**
 		 * Setting default locale for Swing JComponents to work around bug
@@ -91,8 +107,8 @@
 
 	/**
 	 * Initializes a new {@link Translation} with a default translation if a
-	 * simple text is passed. If a "oneLine" text is parsed, it is
-	 * interpreted. Other translations may be added later - this is a HashMap<br/>
+	 * simple text is passed. If a "oneLine" text is parsed, it is interpreted.
+	 * Other translations may be added later - this is a HashMap<br/>
 	 * 
 	 * @param defaultTranslation
 	 * 



More information about the Schmitzm-commits mailing list