Author: fred
Date: 2007-08-10 11:53:53 +0000 (Fri, 10 Aug 2007)
New Revision: 14572
Modified:
trunk/plugins/Echo/src/plugins/echo/NodesManager.java
trunk/plugins/Echo/src/plugins/echo/i18n/I18n.java
Log:
Store the nodes without serialization
Modified: trunk/plugins/Echo/src/plugins/echo/NodesManager.java
===================================================================
--- trunk/plugins/Echo/src/plugins/echo/NodesManager.java 2007-08-09
22:05:40 UTC (rev 14571)
+++ trunk/plugins/Echo/src/plugins/echo/NodesManager.java 2007-08-10
11:53:53 UTC (rev 14572)
@@ -11,6 +11,7 @@
import java.util.Date;
import java.io.File;
import java.io.FileOutputStream;
+import java.io.FileWriter;
import java.io.IOException;
import java.io.FileNotFoundException;
@@ -134,12 +135,20 @@
}
node.setModifiedDate(new Date());
+
+ FileWriter writer = new FileWriter(file);
+ writer.write(node.getDoc().toXML());
+ writer.close();
+ /*
+ Whitespaces gets stripped
+
Serializer serializer = new Serializer(new
FileOutputStream(file));
serializer.setIndent(4);
serializer.setMaxLength(128);
serializer.write(node.getDoc());
+ */
}
public String[] getIds() {
Modified: trunk/plugins/Echo/src/plugins/echo/i18n/I18n.java
===================================================================
--- trunk/plugins/Echo/src/plugins/echo/i18n/I18n.java 2007-08-09 22:05:40 UTC
(rev 14571)
+++ trunk/plugins/Echo/src/plugins/echo/i18n/I18n.java 2007-08-10 11:53:53 UTC
(rev 14572)
@@ -60,8 +60,8 @@
if(props == null)
props = new Properties();
try {
- props.load(getClass().getResourceAsStream("/i18n/" +
PREFIX + language + SUFFIX));
-// props.load(new
FileInputStream("/home/fred/prog/soc/trunk/plugins/Echo/src/plugins/echo/i18n/"
+ PREFIX + language + SUFFIX));
+// props.load(getClass().getResourceAsStream("/i18n/" +
PREFIX + language + SUFFIX));
+ props.load(new
FileInputStream("/home/fred/prog/soc/trunk/plugins/Echo/src/plugins/echo/i18n/"
+ PREFIX + language + SUFFIX));
} catch (IOException ioe) {
Logger.error(this, "IOException while accessing the " +
language +"file" + ioe.getMessage(), ioe);
throw new MissingResourceException("Unable to load the
translation file for " + language, "i18n", language);
@@ -87,8 +87,10 @@
str = defaultTranslation.getProperty(key);
if(str != null)
return str;
- else
+ else {
+ Logger.normal("I18n", "The translation for " +
key + " hasn't been found in the default language !! Please tell the
maintainer.");
return key;
+ }
}
}