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

2006/unicorn/src/org/w3c/unicorn/util Language.java,1.5,1.6

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 02 Oct 2009 16:51:07 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MtlLX-0006RT-LK@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/util
In directory hutz:/tmp/cvs-serv24742/src/org/w3c/unicorn/util

Modified Files:
	Language.java 
Log Message:
improved isComplete method

Index: Language.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/util/Language.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Language.java	30 Sep 2009 14:58:43 -0000	1.5
+++ Language.java	2 Oct 2009 16:51:05 -0000	1.6
@@ -83,7 +83,18 @@
 	}
 
 	public static boolean isComplete(String langParameter) {
-		return Framework.getLanguageProperties().get(langParameter).get("complete").equals("true");
+		Properties testedProps = Framework.getLanguageProperties().get(langParameter);
+		
+		if (testedProps.get("complete") == null) {
+			for (Object key : Framework.getLanguageProperties().get(Property.get("DEFAULT_LANGUAGE")).keySet()) {
+				if (!testedProps.containsKey(key)) {
+					testedProps.put("complete", "false");
+					return false;
+				}
+			}
+			return true;
+		} else
+			return testedProps.get("complete").equals("true");
 	}
 	
 }
Received on Friday, 2 October 2009 16:51:09 UTC

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