Revision 1300

tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/NormalizeKeys.java (revision 1300)
56 56
		HashMap<String, String> messages = pmManager.getMessagesForDefaultLang();
57 57

  
58 58
		ArrayList<String> keys = new ArrayList<String>(pmManager.getMessageKeys());
59

  
59
		ArrayList<String> normalized = new ArrayList<String>();
60
		
60 61
		int n = 0;
61 62
		for (String key : keys) {
62 63
			String value = messages.get(key);
......
104 105
				}
105 106

  
106 107
				pmManager.renameKey(key, newKey);
108
				normalized.add(key);
107 109
//			}
108 110
			n++;
109 111
		}
......
114 116
			System.out.println("NormalizeKeys.normalize(): number of replacements to do: " + pmManager.getKeyModifications().size() + ".");
115 117
		}
116 118

  
119
		if (n > 0) {
120
			System.out.println(" Done: "+n+" changes: "+normalized);
121
		}
117 122
		
118 123
		return n;
119 124
	}
......
258 263
		NormalizeKeys keysNormalizer = new NormalizeKeys(false);
259 264

  
260 265
		WorkspaceMessagesManager wmm = new WorkspaceMessagesManager(false);
266
		int total = 0;
261 267
		for (PluginMessagesManager pm : wmm.getPluginMessages().values()) {
262
			keysNormalizer.normalize(pm);
268
			total += keysNormalizer.normalize(pm);
263 269
			
264
			//pm.saveChanges(true); // mode homme
265
			pm.saveChanges(false);
270
			pm.saveChanges(true); // mode homme
271
			//pm.saveChanges(false);
266 272
		}
267

  
268
		//wmm.saveKeyModificationsInSources();
273
		
274
		if (total > 0) {
275
			wmm.saveKeyModificationsInSources();
276
			System.out.println("Done: "+total+" change.");
277
		} else {
278
			System.out.println("Done: no change.");
279
		}
269 280
	}
270 281
}

Also available in: Unified diff