Index: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessagesManager.java
===================================================================
--- tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessagesManager.java	(revision 1319)
+++ tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessagesManager.java	(revision 1320)
@@ -44,7 +44,7 @@
 	public static String ENCODING = "UTF-8";
 
 	public final static String FILE_SEPARATOR = System.getProperty("file.separator");
-	
+
 	/**
 	 * Debug state.
 	 */
@@ -153,7 +153,7 @@
 	}
 
 
-	
+
 	/**
 	 * 
 	 * @param projectDirectory
@@ -166,8 +166,8 @@
 		this(projectDirectory, javaMessageFile, false);
 	}
 
-	
-	
+
+
 	/**
 	 * 
 	 * @param projectDirectory
@@ -190,7 +190,13 @@
 			System.out.println("PluginMessagesManager.PluginMessages(): java message file = " + this.javaMessageFile);
 		}
 
+		// create the project source files list
+		this.createSourceFilesList();
 
+		//this.createKeysGlobalREGEX();
+		this.createUsedKeysFilesIndex();
+
+
 		if (this.javaMessageFile != null) {
 
 			File[] propFiles = javaMessageFile.getParentFile().listFiles();
@@ -216,7 +222,7 @@
 			String line2 = reader2.readLine();
 			while (line2 != null) {
 				line2 = line2.trim();
-				
+
 				if (line2.startsWith("public static String")) {
 					int idx = line2.indexOf("//");
 					if (idx > 0 && line2.contains("\"")) { // remove comment from line
@@ -225,30 +231,23 @@
 					}
 					if (line2.endsWith(";") && !line2.contains("=") && !line2.contains("\"")) {
 						line2 = line2.substring(21, line2.length() -1);
-						
+
 						if(debug)	{
 							System.out.println("PluginMessagesManager.PluginMessagesManager(): messages key: " + line2 + " added.");
 						}
 						messageKeys.add(line2);
 					}
 				}
-				
+
 				line2 = reader2.readLine();
 			}
 			reader2.close();
-			
-			
+
+
 			if(debug)	{
 				System.out.println("PluginMessagesManager.PluginMessagesManager(): number of keys: " + this.messageKeys.size() + ".");
 			}
-			
 
-			// create the project source files list
-			this.createSourceFilesList();
-
-			//this.createKeysGlobalREGEX();
-			this.createUsedKeysFilesIndex();
-
 			// try loading OSGI messages 
 			if (pluginXMLFile.exists()) {
 				ArrayList<String> result = IOUtils.findWithGroup(pluginXMLFile, "\"%([^\"]+)\"");
@@ -281,112 +280,112 @@
 		}
 	}
 
-//		/**
-//		 * Creates a global REGEX containing all keys to later search in files.
-//		 */
-//		public void createKeysGlobalREGEX()	{
-//			
-//			if(messageKeys.size() == 0) {
-//				return;
-//			}
-//			
-//			StringBuffer buffer = new StringBuffer();
-//			buffer.append(this.getMessageClassName() + "\\\\.(");
-//			
-//			int i = 0;
-//			for (String key : messageKeys) {
-//				if(i > 0)	{
-//					buffer.append("|" + key);	
-//				}
-//				else {
-//					buffer.append(key);
-//				}
-//				i++;
-//			}
-//			
-//			// remove first pipe
-//			//buffer.deleteCharAt(0);
-//			
-//			this.keysGlobalREGEX = Pattern.compile("(" + buffer + "))");
-//			
-//			if(debug)	{
-//				System.out.println("PluginMessagesManager.createKeysGlobalREGEX(): REGEX created: " + this.keysGlobalREGEX + ".");
-//			}
-//			
-//		}
+	//		/**
+	//		 * Creates a global REGEX containing all keys to later search in files.
+	//		 */
+	//		public void createKeysGlobalREGEX()	{
+	//			
+	//			if(messageKeys.size() == 0) {
+	//				return;
+	//			}
+	//			
+	//			StringBuffer buffer = new StringBuffer();
+	//			buffer.append(this.getMessageClassName() + "\\\\.(");
+	//			
+	//			int i = 0;
+	//			for (String key : messageKeys) {
+	//				if(i > 0)	{
+	//					buffer.append("|" + key);	
+	//				}
+	//				else {
+	//					buffer.append(key);
+	//				}
+	//				i++;
+	//			}
+	//			
+	//			// remove first pipe
+	//			//buffer.deleteCharAt(0);
+	//			
+	//			this.keysGlobalREGEX = Pattern.compile("(" + buffer + "))");
+	//			
+	//			if(debug)	{
+	//				System.out.println("PluginMessagesManager.createKeysGlobalREGEX(): REGEX created: " + this.keysGlobalREGEX + ".");
+	//			}
+	//			
+	//		}
 
-		
-		/**
-		 * Creates a global REGEX containing all keys to later search in files.
-		 */
-		public void createKeysGlobalREGEX()	{
-			StringBuffer buffer = new StringBuffer();
-			for (String key : messageKeys) {
-				buffer.append("|" + this.getKeyFullName(key).replaceAll("\\.", "\\\\."));
-			}
-			
-			// remove first pipe
-			buffer.deleteCharAt(0);
-			
-			this.keysGlobalREGEX = Pattern.compile("(" + buffer + ")");
-			
-			if(debug)	{
-				System.out.println("PluginMessagesManager.createKeysGlobalREGEX(): REGEX created: " + this.keysGlobalREGEX + ".");
-			}
-			
+
+	/**
+	 * Creates a global REGEX containing all keys to later search in files.
+	 */
+	public void createKeysGlobalREGEX()	{
+		StringBuffer buffer = new StringBuffer();
+		for (String key : messageKeys) {
+			buffer.append("|" + this.getKeyFullName(key).replaceAll("\\.", "\\\\."));
 		}
-		
-		
-		
-		public static File findMessageFile(File projectDirectory2) {
-			File messagesPackageDir = new File(projectDirectory2, "src/"+projectDirectory2.getName().replaceAll("\\.", "/")+"/messages");
 
-			if (!messagesPackageDir.exists()) {
-				messagesPackageDir = new File(projectDirectory2, "src/java/"+projectDirectory2.getName().replaceAll("\\.", "/")+"/messages");
-			}
-			
-			if (!messagesPackageDir.exists()) {
-				messagesPackageDir = new File(projectDirectory2, "src/main/java/"+projectDirectory2.getName().replaceAll("\\.", "/")+"/messages");
-			}
-			
-			if (!messagesPackageDir.exists()) {
-				return null;
-			}
-			
-			for (File messagesJavaFile : messagesPackageDir.listFiles()) {
-				if (messagesJavaFile.isDirectory()) continue;
-				if (!messagesJavaFile.getName().endsWith("Messages.java")) continue;
-				return messagesJavaFile;
-			}
+		// remove first pipe
+		buffer.deleteCharAt(0);
+
+		this.keysGlobalREGEX = Pattern.compile("(" + buffer + ")");
+
+		if(debug)	{
+			System.out.println("PluginMessagesManager.createKeysGlobalREGEX(): REGEX created: " + this.keysGlobalREGEX + ".");
+		}
+
+	}
+
+
+
+	public static File findMessageFile(File projectDirectory2) {
+		File messagesPackageDir = new File(projectDirectory2, "src/"+projectDirectory2.getName().replaceAll("\\.", "/")+"/messages");
+
+		if (!messagesPackageDir.exists()) {
+			messagesPackageDir = new File(projectDirectory2, "src/java/"+projectDirectory2.getName().replaceAll("\\.", "/")+"/messages");
+		}
+
+		if (!messagesPackageDir.exists()) {
+			messagesPackageDir = new File(projectDirectory2, "src/main/java/"+projectDirectory2.getName().replaceAll("\\.", "/")+"/messages");
+		}
+
+		if (!messagesPackageDir.exists()) {
 			return null;
 		}
-	
-//	public static File findMessageFile(File projectDirectory2) {
-////		System.out.println("PluginMessagesManager.findMessageFile() " + FILE_SEPARATOR);
-//		File messagesPackageDir = new File(projectDirectory2, "src" + FILE_SEPARATOR + projectDirectory2.getName().replaceAll("\\.", "\\" + FILE_SEPARATOR) + FILE_SEPARATOR + "messages");
-//
-//		if (!messagesPackageDir.exists()) {
-//			messagesPackageDir = new File(projectDirectory2, "src" + FILE_SEPARATOR + "java" + FILE_SEPARATOR + projectDirectory2.getName().replaceAll("\\.", "\\" + FILE_SEPARATOR) + FILE_SEPARATOR + "messages");
-//		}
-//
-//		if (!messagesPackageDir.exists()) {
-//			messagesPackageDir = new File(projectDirectory2, "src" + FILE_SEPARATOR + "main" + FILE_SEPARATOR + "java" + FILE_SEPARATOR + projectDirectory2.getName().replaceAll("\\.", "\\" + FILE_SEPARATOR) + FILE_SEPARATOR + "messages");
-//		}
-//
-//		if (!messagesPackageDir.exists()) {
-//			return null;
-//		}
-//
-//		for (File messagesJavaFile : messagesPackageDir.listFiles()) {
-//			if (messagesJavaFile.isDirectory()) continue;
-//			if (!messagesJavaFile.getName().endsWith("Messages.java")) continue;
-//			return messagesJavaFile;
-//		}
-//		return null;
-//	}
 
+		for (File messagesJavaFile : messagesPackageDir.listFiles()) {
+			if (messagesJavaFile.isDirectory()) continue;
+			if (!messagesJavaFile.getName().endsWith("Messages.java")) continue;
+			return messagesJavaFile;
+		}
+		return null;
+	}
 
-	
+	//	public static File findMessageFile(File projectDirectory2) {
+	////		System.out.println("PluginMessagesManager.findMessageFile() " + FILE_SEPARATOR);
+	//		File messagesPackageDir = new File(projectDirectory2, "src" + FILE_SEPARATOR + projectDirectory2.getName().replaceAll("\\.", "\\" + FILE_SEPARATOR) + FILE_SEPARATOR + "messages");
+	//
+	//		if (!messagesPackageDir.exists()) {
+	//			messagesPackageDir = new File(projectDirectory2, "src" + FILE_SEPARATOR + "java" + FILE_SEPARATOR + projectDirectory2.getName().replaceAll("\\.", "\\" + FILE_SEPARATOR) + FILE_SEPARATOR + "messages");
+	//		}
+	//
+	//		if (!messagesPackageDir.exists()) {
+	//			messagesPackageDir = new File(projectDirectory2, "src" + FILE_SEPARATOR + "main" + FILE_SEPARATOR + "java" + FILE_SEPARATOR + projectDirectory2.getName().replaceAll("\\.", "\\" + FILE_SEPARATOR) + FILE_SEPARATOR + "messages");
+	//		}
+	//
+	//		if (!messagesPackageDir.exists()) {
+	//			return null;
+	//		}
+	//
+	//		for (File messagesJavaFile : messagesPackageDir.listFiles()) {
+	//			if (messagesJavaFile.isDirectory()) continue;
+	//			if (!messagesJavaFile.getName().endsWith("Messages.java")) continue;
+	//			return messagesJavaFile;
+	//		}
+	//		return null;
+	//	}
+
+
+
 	/**
 	 * Creates/updates the index of the keys used and their associated files.
 	 * @throws IOException 
@@ -395,20 +394,20 @@
 		this.usedKeysFilesIndex = new TreeMap<String, TreeSet<File>>();
 
 		// Old version, based on real key name
-//		for (File file : this.srcFiles) {
-//			for (String key : messageKeys) {
-//				if(debug) {
-//					System.out.println("PluginMessagesManager.createUsedKeysIndex(): looking for key " + this.getKeyFullName(key) + " in project source files...");
-//				}
-//				String lines = IOUtils.getText(file, PluginMessagesManager.ENCODING);
-//				if(lines.contains(this.getKeyFullName(key)))	{
-//					if (!this.usedKeysFilesIndex.containsKey(key)) {
-//						this.usedKeysFilesIndex.put(key, new TreeSet<File>());
-//					}
-//					this.usedKeysFilesIndex.get(key).add(file);
-//				};
-//			}
-//		}
+		//		for (File file : this.srcFiles) {
+		//			for (String key : messageKeys) {
+		//				if(debug) {
+		//					System.out.println("PluginMessagesManager.createUsedKeysIndex(): looking for key " + this.getKeyFullName(key) + " in project source files...");
+		//				}
+		//				String lines = IOUtils.getText(file, PluginMessagesManager.ENCODING);
+		//				if(lines.contains(this.getKeyFullName(key)))	{
+		//					if (!this.usedKeysFilesIndex.containsKey(key)) {
+		//						this.usedKeysFilesIndex.put(key, new TreeSet<File>());
+		//					}
+		//					this.usedKeysFilesIndex.get(key).add(file);
+		//				};
+		//			}
+		//		}
 
 		// New version using REGEX
 		for (File file : this.srcFiles) {
@@ -420,12 +419,12 @@
 			while (m.find()) {
 				// Get the matching string
 				String key = m.group();
-				
+
 				if (!this.usedKeysFilesIndex.containsKey(key)) {
 					this.usedKeysFilesIndex.put(key, new TreeSet<File>());
 				}
 				this.usedKeysFilesIndex.get(key).add(file);
-				
+
 				if(debug) {
 					System.out.println("PluginMessagesManager.createUsedKeysFilesIndex(): messages key: " + key + " added for file " + file +  ".");
 				}
@@ -447,7 +446,7 @@
 			System.out.println("PluginMessagesManager.dumpUsedKeysIndex(): project have no used keys.");
 			return;
 		}
-		
+
 		for (Map.Entry<String, TreeSet<File>> entry : this.usedKeysFilesIndex.entrySet()) {
 			System.out.println("key: " + entry.getKey());
 			if(entry.getValue().isEmpty())	{
@@ -459,7 +458,7 @@
 				}
 			}
 		}
-		
+
 		System.out.println("PluginMessagesManager.dumpUsedKeysIndex(): number of used keys: " + this.usedKeysFilesIndex.size() + ".");
 	}
 
@@ -641,19 +640,19 @@
 
 		// write message File
 		File newJavaMessageFile = new File(javaMessageFile.getParentFile(), javaMessageFile.getName()+".new");
-		
+
 		ArrayList<String> lines = IOUtils.getLines(javaMessageFile, "UFT-8");
 		TreeSet<String> oldKeys = new TreeSet<String>(IOUtils.findWithGroup(javaMessageFile, "public static String ([^\"=;]+);"));
 		TreeSet<String> newKeys = new TreeSet<String>(messageKeys);
 		newKeys.removeAll(oldKeys);
 		newKeys.removeAll(keyModifications.values()); // now contains only the very newly created keys
-		
+
 		if (replaceFiles) {
 			newJavaMessageFile = javaMessageFile;
 		}
 
 		PrintWriter out = IOUtils.getWriter(newJavaMessageFile, ENCODING);
-		
+
 		// update lines
 		for (String line : lines) {
 			String l = line.trim();// remove tabs
@@ -663,10 +662,10 @@
 				comments = l.substring(idx).trim();
 				l = l.substring(0, idx).trim();
 			}
-			
+
 			if (l.startsWith("private static final String BUNDLE_NAME")) {
 				out.println(line);
-				
+
 				// write the totally new keys
 				if (newKeys.size() > 0) {
 					out.println("\t");
@@ -675,7 +674,7 @@
 					out.println("\tpublic static String "+key+";");
 				}
 			} else if (l.startsWith("public static String") && l.endsWith(";") && !l.contains("=") && !l.contains("\"")) {
-				
+
 				String key = l.substring(21, l.length() -1);
 				if (messageKeys.contains(key)) {
 					out.println(line); // keep the line
@@ -689,7 +688,7 @@
 				out.println(line);
 			}
 		}
-		
+
 		out.close();
 	}
 
@@ -835,7 +834,7 @@
 		while (messageKeys.contains(newKey)) {
 			newKey = key+"_"+(c++);
 		}
-		
+
 		messageKeys.add(newKey);
 		getMessagesForDefaultLang().put(newKey, defaultMessage);
 	}
@@ -903,7 +902,7 @@
 	public static void main(String[] args) throws UnsupportedEncodingException, FileNotFoundException, IOException {
 
 		long startTime = System.currentTimeMillis();
-		
+
 		//File projectFile = new File(new File(System.getProperty("user.dir")).getParentFile().getAbsolutePath() + "/org.txm.rcp");
 		File projectFile = new File(new File(System.getProperty("user.dir")).getParentFile().getAbsolutePath() + "/org.txm.core");
 
@@ -936,7 +935,7 @@
 
 		System.out.println("dir="+pmManager.getProjectDirectory());
 		System.out.println("Elapsed time:"+ ((double)(System.currentTimeMillis()-startTime)/1000));
-		
+
 		System.out.println("PluginMessagesManager.main(): done.");
 	}
 }
\ No newline at end of file
Index: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/WorkspaceMessagesManager.java
===================================================================
--- tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/WorkspaceMessagesManager.java	(revision 1319)
+++ tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/WorkspaceMessagesManager.java	(revision 1320)
@@ -63,7 +63,7 @@
 	public WorkspaceMessagesManager() throws UnsupportedEncodingException, FileNotFoundException, IOException {
 		this(false);
 	}
-	
+
 	/**
 	 * Creates the manager using the "user.dir" parent directory -> works when run from Eclipse
 	 * 
@@ -91,7 +91,7 @@
 
 		this.workspaceLocation = workspaceLocation;
 		this.debug = debug;
-		
+
 		if (debug) {
 			System.out.println("WorkspaceMessagesManager.WorkspaceMessagesManager(): workspace location = " + this.workspaceLocation);
 		}
@@ -105,24 +105,24 @@
 			if (!project.getName().startsWith("org.txm")) continue;
 			if (project.getName().endsWith(".feature")) continue;
 
-//			File messagesPackageDir = new File(project, "src/"+project.getName().replaceAll("\\.", "/")+"/messages");
-//			if (!messagesPackageDir.exists()) {
-//				messagesPackageDir = new File(project, "src/java/"+project.getName().replaceAll("\\.", "/")+"/messages");
-//			}
-//			//System.out.println(messagesPackageDir.getAbsolutePath());
-//
-//			File messagesJavaFile = PluginMessages.findMessageFile(project);
+			//			File messagesPackageDir = new File(project, "src/"+project.getName().replaceAll("\\.", "/")+"/messages");
+			//			if (!messagesPackageDir.exists()) {
+			//				messagesPackageDir = new File(project, "src/java/"+project.getName().replaceAll("\\.", "/")+"/messages");
+			//			}
+			//			//System.out.println(messagesPackageDir.getAbsolutePath());
+			//
+			//			File messagesJavaFile = PluginMessages.findMessageFile(project);
 
-//			if (messagesJavaFile != null && messagesJavaFile.exists()) {
+			//			if (messagesJavaFile != null && messagesJavaFile.exists()) {
 
-				PluginMessagesManager messages = new PluginMessagesManager(project, debug);
+			PluginMessagesManager messages = new PluginMessagesManager(project, debug);
 
-				pluginsMessagesPerProject.put(project, messages);
+			pluginsMessagesPerProject.put(project, messages);
 
-				if (debug) {
-					System.out.println(project + "=" + messages.getLangs().size() + " langs.");
-				}
-//			}
+			if (debug) {
+				System.out.println(project + "=" + messages.getLangs().size() + " langs.");
+			}
+			//			}
 		}
 
 		this.createUsedKeysFilesIndex();
@@ -161,7 +161,7 @@
 				}
 			}
 		}
-		
+
 		System.out.println("WorkspaceMessagesManager.dumpUsedKeysFilesIndex(): number of used keys: " + this.usedKeysFilesIndex.size());
 	}
 
@@ -207,23 +207,23 @@
 
 		System.out.println("Keys to update: "+keys);
 		ArrayList<String> updated = new ArrayList<String>();
-//		for (PluginMessagesManager pm : pluginsMessagesPerProject.values()) {
-			TreeMap<String, TreeSet<File>> index = getUsedKeysFilesIndex();
-			
-			for (String oldKey : keys) {
-				if (index.containsKey(oldKey)) {
-					TreeSet<File> files = index.get(oldKey);
-					if (files.size() > 0) {
-						System.out.println("Replace KEY="+oldKey+" BY KEY="+modifications.get(oldKey));
-						for (File srcFile : files) {
-							System.out.println(" "+srcFile+" "+oldKey+" -> "+modifications.get(oldKey));
-							IOUtils.replaceAll(srcFile, oldKey, modifications.get(oldKey));
-						}
-						updated.add(oldKey);
+		//		for (PluginMessagesManager pm : pluginsMessagesPerProject.values()) {
+		TreeMap<String, TreeSet<File>> index = getUsedKeysFilesIndex();
+
+		for (String oldKey : keys) {
+			if (index.containsKey(oldKey)) {
+				TreeSet<File> files = index.get(oldKey);
+				if (files.size() > 0) {
+					System.out.println("Replace KEY="+oldKey+" BY KEY="+modifications.get(oldKey));
+					System.out.println("Files: "+files);
+					for (File srcFile : files) {
+						IOUtils.replaceAll(srcFile, oldKey, modifications.get(oldKey));
 					}
+					updated.add(oldKey);
 				}
 			}
-//		}
+		}
+		//		}
 	}
 
 	/**
@@ -270,7 +270,7 @@
 				System.err.println("WorkspaceMessagesManager.createUsedKeysFilesIndex(): project " + pmManager.getProjectDirectory() + " have no used keys.");
 				continue;
 			}
-			
+
 			for (Map.Entry<String, TreeSet<File>> entry :index.entrySet()) {
 
 				//String fullKeyName = pmManager.getKeyFullName(entry.getKey());
