Index: maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/extension/ParserXml.java diff -u maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/extension/ParserXml.java:1.5 maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/extension/ParserXml.java:1.6 --- maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/extension/ParserXml.java:1.5 Fri Nov 2 16:06:37 2007 +++ maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/extension/ParserXml.java Tue Nov 6 17:19:41 2007 @@ -20,6 +20,7 @@ package org.codelutin.i18n.plugin.extension; import java.io.File; +import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -62,6 +63,8 @@ protected XPath xpath; protected Properties result; + protected Properties oldProperties; + /** * Initialisation des paramètres du parser */ @@ -84,11 +87,18 @@ this.rules = getRules(fileRules); this.xpath = factory.newXPath(); this.result = new Properties(); - out.mkdirs(); + this.oldProperties = new Properties(); + + out.mkdirs(); + try { + File oldFile = new File(out.getAbsolutePath() + File.separatorChar + outGetter); + oldFile.createNewFile(); + oldProperties.load(new FileInputStream(oldFile)); + parse(); - } catch (ParserException e) { + } catch (Exception e) { log.error("Error XML parsing ", e); throw new MojoFailureException("Error XML parsing"); } @@ -164,7 +174,12 @@ event.eventChangeKey(key); keyModified = event.eventGetRealKey(); } - result.put(keyModified, key); + + if(oldProperties.containsKey(key)) { + result.put(keyModified, oldProperties.get(key)); + } else { + result.put(keyModified, key); + } } } Index: maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/extension/ParserJava.java diff -u maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/extension/ParserJava.java:1.5 maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/extension/ParserJava.java:1.6 --- maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/extension/ParserJava.java:1.5 Fri Nov 2 16:06:37 2007 +++ maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/extension/ParserJava.java Tue Nov 6 17:19:41 2007 @@ -61,6 +61,7 @@ protected I18nFilter filter; protected Properties result; + protected Properties oldProperties; /* * (non-Javadoc) @@ -69,6 +70,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { this.result = new Properties(); this.filter = new I18nFilter(); + this.oldProperties = new Properties(); // Événements if(keysModifier) { @@ -78,8 +80,12 @@ out.mkdirs(); try { + File oldFile = new File(out.getAbsolutePath() + File.separatorChar + "java.getter"); + oldFile.createNewFile(); + oldProperties.load(new FileInputStream(oldFile)); + parse(); - } catch (ParserException e) { + } catch (Exception e) { log.error("Error code parsing ", e); throw new MojoFailureException("Error code parsing"); } @@ -153,7 +159,12 @@ event.eventChangeKey(key); keyModified = event.eventGetRealKey(); } - result.put(keyModified, key); + + if(oldProperties.containsKey(key)) { + result.put(keyModified, oldProperties.get(key)); + } else { + result.put(keyModified, key); + } } } }