Révision 1280

tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/NormalizeKeys.java (revision 1280)
233 233
		WorkspaceMessagesManager wmm = new WorkspaceMessagesManager();
234 234
		for (PluginMessagesManager pm : wmm.getPluginMessages().values()) {
235 235
			keysNormalizer.normalize(pm);
236
			
237
			pm.saveChanges(true);
236 238
		}
237 239

  
238
		//wmm.saveKeyModificationsInSources();
240
		wmm.saveKeyModificationsInSources();
239 241
	}
240 242
}
tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessagesManager.java (revision 1280)
235 235
					}
236 236
				}
237 237
				
238
				
239 238
				line2 = reader2.readLine();
240 239
			}
241 240
			reader2.close();
tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/WorkspaceMessagesManager.java (revision 1280)
14 14
import java.util.TreeSet;
15 15
import java.util.regex.Pattern;
16 16

  
17
import org.txm.utils.io.IOUtils;
18

  
17 19
/**
18 20
 * Manages the messages of the TXM projects of an RCP workspace
19 21
 * 
......
162 164

  
163 165
	/**
164 166
	 * Save modifications of keys of all known PluginMessages in all known source files
167
	 * @throws IOException 
165 168
	 */
166
	public void saveKeyModificationsInSources() {
169
	public void saveKeyModificationsInSources() throws IOException {
167 170
		HashMap<String, String> modifications = new HashMap<String, String>();
168 171

  
169 172
		// stores all modifications
......
208 211
					TreeSet<File> files = index.get(oldKey);
209 212
					if (files.size() > 0) {
210 213
						System.out.println("REPLACE IN SOURCE FILES THE KEY="+oldKey+" BY KEY="+modifications.get(oldKey));
214
						for (File srcFile : files) {
215
							IOUtils.replaceAll(srcFile, oldKey, modifications.get(oldKey));
216
						}
211 217
						updated.add(oldKey);
212 218
					}
213 219
				}

Formats disponibles : Unified diff