Index: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindUnusedTranslations.java
===================================================================
--- tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindUnusedTranslations.java	(revision 1262)
+++ tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindUnusedTranslations.java	(revision 1263)
@@ -1,40 +0,0 @@
-package org.txm.rcp.translate.devtools;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-
-import org.txm.rcp.translate.i18n.PluginMessages;
-import org.txm.rcp.translate.i18n.WorkspaceMessagesManager;
-import org.txm.utils.BiHashMap;
-
-public class FindUnusedTranslations {
-	public static void main(String[] args) throws UnsupportedEncodingException, FileNotFoundException, IOException {
-		WorkspaceMessagesManager wmm = new WorkspaceMessagesManager();
-		LinkedHashMap<File, PluginMessages> h = wmm.getPluginMessages();
-
-		String langs[] = {"", "_fr", "_ru"};
-
-		for (File project : h.keySet()) {
-
-			PluginMessages messages = h.get(project);
-			LinkedHashSet<String> keys = messages.getMessageKeys();
-			for (String lang : langs) {
-				BiHashMap<String, String> lmessages = messages.getMessagesForLang(lang);
-				if (lmessages == null) continue;
-				
-				for (String k : lmessages.getKeys()) {
-					if (!keys.contains(k)) {
-						System.out.println(" Remove key="+k);
-						lmessages.removeByKey(k);
-					}
-				}
-			}
-			
-			// messages.saveChanges();
-		}
-	}
-}
\ No newline at end of file
Index: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindMissingTranslations.java
===================================================================
--- tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindMissingTranslations.java	(revision 1262)
+++ tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindMissingTranslations.java	(revision 1263)
@@ -1,5 +0,0 @@
-package org.txm.rcp.translate.devtools;
-
-public class FindMissingTranslations {
-
-}
Index: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/RemoveUnusedTranslations.java
===================================================================
--- tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/RemoveUnusedTranslations.java	(revision 0)
+++ tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/RemoveUnusedTranslations.java	(revision 1263)
@@ -0,0 +1,40 @@
+package org.txm.rcp.translate.devtools;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+
+import org.txm.rcp.translate.i18n.PluginMessages;
+import org.txm.rcp.translate.i18n.WorkspaceMessagesManager;
+import org.txm.utils.BiHashMap;
+
+public class RemoveUnusedTranslations {
+	public static void main(String[] args) throws UnsupportedEncodingException, FileNotFoundException, IOException {
+		WorkspaceMessagesManager wmm = new WorkspaceMessagesManager();
+		LinkedHashMap<File, PluginMessages> h = wmm.getPluginMessages();
+
+		String langs[] = {"", "_fr", "_ru"};
+
+		for (File project : h.keySet()) {
+
+			PluginMessages messages = h.get(project);
+			LinkedHashSet<String> keys = messages.getMessageKeys();
+			for (String lang : langs) {
+				BiHashMap<String, String> lmessages = messages.getMessagesForLang(lang);
+				if (lmessages == null) continue;
+				
+				for (String k : lmessages.getKeys()) {
+					if (!keys.contains(k)) {
+						System.out.println(" Remove key="+k);
+						lmessages.removeByKey(k);
+					}
+				}
+			}
+			
+			// messages.saveChanges();
+		}
+	}
+}
\ No newline at end of file

Property changes on: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/RemoveUnusedTranslations.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindBugsInPropertiesFiles.java
===================================================================
--- tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindBugsInPropertiesFiles.java	(revision 0)
+++ tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindBugsInPropertiesFiles.java	(revision 1263)
@@ -0,0 +1,13 @@
+package org.txm.rcp.translate.devtools;
+
+/**
+ * Test properties files :
+ * - no duplicated key
+ * - no empty message
+ * 
+ * @author mdecorde
+ *
+ */
+public class FindBugsInPropertiesFiles {
+
+}

Property changes on: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindBugsInPropertiesFiles.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/NormalizeKeys.java
===================================================================
--- tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/NormalizeKeys.java	(revision 1262)
+++ tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/NormalizeKeys.java	(revision 1263)
@@ -18,12 +18,12 @@
  *
  */
 public class NormalizeKeys {
-	
+
 	/**
 	 * Debug state.
 	 */
 	protected boolean debug = false;
-	
+
 	/**
 	 * Keys matching this REGEX will be preserved.
 	 */
@@ -48,9 +48,9 @@
 	public int normalize(PluginMessages pmManager)	{
 
 		BiHashMap<String, String> messages = pmManager.getMessagesForDefaultLang();
-		
+
 		ArrayList<String> keys = new ArrayList<String>(pmManager.getMessageKeys());
-		
+
 		int n = 0;
 		for (String key : keys) {
 			String value = messages.get(key);
@@ -68,53 +68,66 @@
 				if (debug)  System.err.println("NormalizeKeys.normalize(): warning: empty string for key: " + key); 
 				continue;
 			}
-			
+
 			String newKeyOrig = normalize(messages.get(key));
-			String newKey = ""+newKeyOrig;
-			int c = 2;
-			while (pmManager.getMessageKeys().contains(newKey)) {
-				newKey += newKeyOrig+"_"+(c++);
+
+			if (value.equals(messages.get(newKeyOrig))) { // the newKey Value == the value
+				//A=hello world
+				//B=hello world
+				// rename A -> helloWorld
+				//B -> helloWorld SAUF QUE helloWorld existe ET meme valeur que valeur(B) valeur(helloWorld)
+
+				pmManager.removeKey(key); // remove the old key
+			} else {
+				// A=hello world
+				// B=hello world!
+				// A et B n'ont pas la meme clé
+				
+				String newKey = ""+newKeyOrig;
+				int c = 2;
+				while (pmManager.getMessageKeys().contains(newKey)) {
+					newKey += newKeyOrig+"_"+(c++);
+				}
+
+				pmManager.renameKey(key, newKey);
 			}
-			
-			pmManager.renameKey(key, newKey);
-			
 			n++;
 		}
-		
+
 		return n;
 	}
-	
-	
-	
-//	/**
-//	 * Normalizes the keys of the specified messages map.
-//	 * @param messages
-//	 * @return
-//	 */
-//	public BiHashMap<String, String> normalize(BiHashMap<String, String> messages)	{
-//		
-//		for (String key : messages.getKeys()) {
-//			String value = messages.get(key);
-//			
-//			// already formatted message
-//			if(key.matches(preserve))	{
-//				System.err.println("NormalizeKeys.normalize(): warning: skipped: " + key + "=" + value);
-//				continue;
-//			}
-//			// empty message
-//			else if(value.length() == 0)	{
-//				System.err.println("NormalizeKeys.normalize(): warning: empty string for key: " + key); 
-//				continue;
-//			}
-//			
-//			messages.put(normalize(messages.get(key)), messages.get(key));
-//			//messages.removeByKey(key);
-//		}
-//		
-//		return messages;
-//	}
-//	
 
+
+
+	//	/**
+	//	 * Normalizes the keys of the specified messages map.
+	//	 * @param messages
+	//	 * @return
+	//	 */
+	//	public BiHashMap<String, String> normalize(BiHashMap<String, String> messages)	{
+	//		
+	//		for (String key : messages.getKeys()) {
+	//			String value = messages.get(key);
+	//			
+	//			// already formatted message
+	//			if(key.matches(preserve))	{
+	//				System.err.println("NormalizeKeys.normalize(): warning: skipped: " + key + "=" + value);
+	//				continue;
+	//			}
+	//			// empty message
+	//			else if(value.length() == 0)	{
+	//				System.err.println("NormalizeKeys.normalize(): warning: empty string for key: " + key); 
+	//				continue;
+	//			}
+	//			
+	//			messages.put(normalize(messages.get(key)), messages.get(key));
+	//			//messages.removeByKey(key);
+	//		}
+	//		
+	//		return messages;
+	//	}
+	//	
+
 	/**
 	 * Normalizes the specified string.
 	 * @param str
@@ -125,15 +138,15 @@
 		if(debug)	{
 			System.out.println("NormalizeKeys.normalize(): normalizing: " + str);
 		}
-		
+
 		str = str.replaceAll("[^a-zA-Z0-9 ]", "").trim();
-		
+
 		// empty string
 		if(str.length() == 0)	{
 			System.err.println("NormalizeKeys.normalize(): warning: empty string.");
 		}
 		else	{
-			
+
 			String[] words = str.split(" ");
 			str = "";
 			for (int i = 0; i < words.length; i++) {
@@ -154,7 +167,7 @@
 					// nothing to do
 				}
 			}
-			
+
 			// uncapitalize first letter
 			String tmpString = str.substring(0, 1).toLowerCase();
 			try {
@@ -170,10 +183,10 @@
 		if(debug)	{
 			System.out.println("   => " + str);
 		}
-		
+
 		return str;
 	}
-	
+
 	/**
 	 * 
 	 * @param args
@@ -183,47 +196,47 @@
 	 */
 	public static void main(String[] args) throws UnsupportedEncodingException, FileNotFoundException, IOException {
 
-//		try {
-//			System.out.println("NormalizeKeys.main(): starting process...");
-//			
-//			File projectFile = new File(new File(System.getProperty("user.dir")).getParentFile().getAbsolutePath() + "/org.txm.core");
-//			File messageFile = new File(projectFile, "src/java/org/txm/core/messages/TXMCoreMessages.java");
-//			
-//			PluginMessages pmManager = new PluginMessages(projectFile, messageFile, false);
-//			NormalizeKeys keysNormalizer = new NormalizeKeys(true);
-//			
-//			// tests
-//			keysNormalizer.normalize(pmManager);
-//
-//			//pmManager.dump(pmManager.getMessagesForMainLang());
-//			pmManager.dumpKeysReplacements();
-//			
-//			System.out.println("NormalizeKeys.main(): number of keys: " + pmManager.getMessageKeys().size() + ".");
-//			System.out.println("NormalizeKeys.main(): number of replacements to do: " + pmManager.getKeyModifications().size() + ".");
-//
-//			System.out.println("NormalizeKeys.main(): terminated.");
-//			
-//		}
-//		catch (UnsupportedEncodingException e) {
-//			// TODO Auto-generated catch block
-//			e.printStackTrace();
-//		}
-//		catch (FileNotFoundException e) {
-//			// TODO Auto-generated catch block
-//			e.printStackTrace();
-//		}
-//		catch (IOException e) {
-//			// TODO Auto-generated catch block
-//			e.printStackTrace();
-//		}
-		
+		//		try {
+		//			System.out.println("NormalizeKeys.main(): starting process...");
+		//			
+		//			File projectFile = new File(new File(System.getProperty("user.dir")).getParentFile().getAbsolutePath() + "/org.txm.core");
+		//			File messageFile = new File(projectFile, "src/java/org/txm/core/messages/TXMCoreMessages.java");
+		//			
+		//			PluginMessages pmManager = new PluginMessages(projectFile, messageFile, false);
+		//			NormalizeKeys keysNormalizer = new NormalizeKeys(true);
+		//			
+		//			// tests
+		//			keysNormalizer.normalize(pmManager);
+		//
+		//			//pmManager.dump(pmManager.getMessagesForMainLang());
+		//			pmManager.dumpKeysReplacements();
+		//			
+		//			System.out.println("NormalizeKeys.main(): number of keys: " + pmManager.getMessageKeys().size() + ".");
+		//			System.out.println("NormalizeKeys.main(): number of replacements to do: " + pmManager.getKeyModifications().size() + ".");
+		//
+		//			System.out.println("NormalizeKeys.main(): terminated.");
+		//			
+		//		}
+		//		catch (UnsupportedEncodingException e) {
+		//			// TODO Auto-generated catch block
+		//			e.printStackTrace();
+		//		}
+		//		catch (FileNotFoundException e) {
+		//			// TODO Auto-generated catch block
+		//			e.printStackTrace();
+		//		}
+		//		catch (IOException e) {
+		//			// TODO Auto-generated catch block
+		//			e.printStackTrace();
+		//		}
+
 		NormalizeKeys keysNormalizer = new NormalizeKeys(false);
-		
+
 		WorkspaceMessagesManager wmm = new WorkspaceMessagesManager();
 		for (PluginMessages pm : wmm.getPluginMessages().values()) {
 			keysNormalizer.normalize(pm);
 		}
-		
+
 		//wmm.saveKeyModificationsInSources();
 	}
 }
Index: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessages.java
===================================================================
--- tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessages.java	(revision 1262)
+++ tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessages.java	(revision 1263)
@@ -66,7 +66,7 @@
 
 
 	/**
-	 * Global REGEX containing all keys to later use for search in files.
+	 * TODO Global REGEX containing all keys to later use for search in files.
 	 */
 	protected Pattern keysGlobalREGEX = Pattern.compile("...");
 
