W3C home > Mailing lists > Public > www-validator-cvs@w3.org > October 2009

2006/unicorn/src/org/w3c/unicorn/action LanguageAction.java,1.2,1.3

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 05 Oct 2009 12:13:18 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MumRK-0004EG-Gf@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/action
In directory hutz:/tmp/cvs-serv16242/src/org/w3c/unicorn/action

Modified Files:
	LanguageAction.java 
Log Message:
defaultProperties is a TreeMap to sort alphabetically 

Index: LanguageAction.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/LanguageAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- LanguageAction.java	2 Oct 2009 16:59:55 -0000	1.2
+++ LanguageAction.java	5 Oct 2009 12:13:16 -0000	1.3
@@ -27,7 +27,7 @@
 	
 	private static TreeMap<String, Properties> languageProperties;
 	
-	private static Properties defaultProperties;
+	private static TreeMap<String, String> defaultProperties = new TreeMap<String, String>();
 
 	/**
 	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
@@ -56,7 +56,7 @@
 		
 		
 		
-		languages.put(defaultLang, defaultProperties.getProperty("language"));
+		languages.put(defaultLang, defaultProperties.get("language"));
 		velocityContext.put("languages", languages);
 		languageProperties.remove(defaultLang);
 		velocityContext.put("languageProps", languageProperties);
@@ -88,14 +88,19 @@
 		LanguageAction.languageProperties = languageProperties;
 	}
 
-	public static Properties getDefaultProperties() {
+	public static TreeMap<String, String> getDefaultProperties() {
 		return defaultProperties;
 	}
 
-	public static void setDefaultProperties(Properties defaultProperties) {
+	public static void setDefaultProperties(TreeMap<String, String> defaultProperties) {
 		LanguageAction.defaultProperties = defaultProperties;
 	}
 	
-	
+	public static void setDefaultProperties(Properties defaultProperties) {
+		for (Object obj : defaultProperties.keySet()) {
+			String key = (String) obj;
+			LanguageAction.defaultProperties.put(key, defaultProperties.getProperty(key));
+		}
+	}
 
 }
Received on Monday, 5 October 2009 12:13:19 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:39 UTC