- From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 03 Mar 2010 17:20:46 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn
In directory hutz:/tmp/cvs-serv24967/src/org/w3c/unicorn
Modified Files:
Framework.java
Log Message:
Cleans any unexisting property from a language file before using it
Index: Framework.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/Framework.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- Framework.java 23 Oct 2009 13:24:41 -0000 1.28
+++ Framework.java 3 Mar 2010 17:20:43 -0000 1.29
@@ -129,7 +129,6 @@
} catch (InitializationFailedException e) {
logger.fatal(e.getMessage(), e);
}
-
}
public static void initCore() throws InitializationFailedException {
@@ -164,8 +163,8 @@
logger.warn("Log4j config file \"log4j.properties\" could not be found: " + log4jPath);
logger.warn("Log4j will not be initialized");
}
-
- }
+ }
+
public static void initConfig() throws InitializationFailedException {
// Load unicorn.properties
logger.debug("-------------------------------------------------------");
@@ -193,6 +192,7 @@
}
}
}
+
public static void initUnmarshallers() {
// Initialize WADLUnmarshallerXPath (Gets the Namespace URI and the prefix)
WADLUnmarshallerXPath.setNamespaceContext(new NamespaceContext() {
@@ -364,6 +364,7 @@
logger.info("OK - " + mapOfObserver.size() + " observer(s) successfully loaded.");
}
}
+
public static void initTasklists() throws InitializationFailedException {
logger.debug("-------------------------------------------------------");
logger.debug("Loading xml task files from tasklist directory: " + Property.get("PATH_TO_TASKLIST"));
@@ -421,6 +422,7 @@
logger.info("OK - " + mapOfTask.size() + " task(s) successfully loaded.");
}
}
+
public static void initLanguages() throws InitializationFailedException {
// Loading language files
logger.debug("-------------------------------------------------------");
@@ -455,11 +457,14 @@
continue;
try {
UCNProperties props = Language.load(langFile);
- logger.debug("> Found language: " + props.getProperty("lang") + " - " + props.getProperty("language"));
- LanguageAction.addLanguageProperties(props);
- Language.complete(props, defaultProps);
- props.parse();
- languageProperties.put(props.getProperty("lang"), props);
+ if (!props.getProperty("lang").equals(Property.get("DEFAULT_LANGUAGE"))) {
+ logger.debug("> Found language: " + props.getProperty("lang") + " - " + props.getProperty("language"));
+ Language.clean(props, defaultProps);
+ LanguageAction.addLanguageProperties(props);
+ Language.complete(props, defaultProps);
+ props.parse();
+ languageProperties.put(props.getProperty("lang"), props);
+ }
} catch (IllegalArgumentException e) {
logger.warn(e.getMessage());
} catch (FileNotFoundException e) {
@@ -488,7 +493,8 @@
}
LanguageAction.setAvailableLocales(Language.getAvailablesLocales());
- }
+ }
+
public static void initVelocity() throws InitializationFailedException {
// Creating velocity contexts
logger.debug("-------------------------------------------------------");
Received on Wednesday, 3 March 2010 17:20:48 UTC