Revision 1319

tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/NormalizeKeys.java (revision 1319)
252 252
		//			e.printStackTrace();
253 253
		//		}
254 254

  
255
		NormalizeKeys keysNormalizer = new NormalizeKeys(true);
255
		NormalizeKeys keysNormalizer = new NormalizeKeys(false);
256 256

  
257
//		WorkspaceMessagesManager wmm = new WorkspaceMessagesManager(false);
258
//		int total = 0;
259
//		for (PluginMessagesManager pm : wmm.getPluginMessages().values()) {
260
//			total += keysNormalizer.normalize(pm);
261
//			
262
//			pm.saveChanges(true); // mode homme
263
//			//pm.saveChanges(false);
264
//		}
265
//		
266
//		if (total > 0) {
267
//			wmm.saveKeyModificationsInSources();
268
//			System.out.println("Done: "+total+" change.");
269
//		} else {
270
//			System.out.println("Done: no change.");
271
//		}		
257
		WorkspaceMessagesManager wmm = new WorkspaceMessagesManager(false);
258
		int total = 0;
259
		for (PluginMessagesManager pm : wmm.getPluginMessages().values()) {
260
			total += keysNormalizer.normalize(pm);
261
			
262
			pm.saveChanges(true); // mode homme
263
			//pm.saveChanges(false);
264
		}
265
		
266
		if (total > 0) {
267
			wmm.saveKeyModificationsInSources();
268
			System.out.println("Done: "+total+" change.");
269
		} else {
270
			System.out.println("Done: no change.");
271
		}		
272 272

  
273 273
//		WorkspaceMessagesManager wmm = new WorkspaceMessagesManager(false);
274 274
//		
......
285 285
//		wmm.saveKeyModificationsInSources();
286 286
		
287 287

  
288
		WorkspaceMessagesManager wmm = new WorkspaceMessagesManager(false);
289
		
290
		for (PluginMessagesManager pmManager : wmm.getPluginMessages().values()) {
291
			if (!pmManager.getProjectDirectory().getName().equals("org.txm.chartsengine.core")) continue;
292

  
293

  
294
			System.out.println("KEYS="+pmManager.getMessageKeys());
295
			keysNormalizer.normalize(pmManager);
296
			System.out.println("KEYS2="+pmManager.getMessageKeys());
297
			System.out.println("MODIFS="+pmManager.getKeyModifications());
298
			pmManager.saveChanges(true); // mode homme
299

  
300
			//pmManager.saveChanges(false);
301
			
302
			System.out.println("INDEX="+pmManager.getUsedKeysFilesIndex());
303
		}
304

  
305
		//System.out.println("FULLINDEX="+wmm.getUsedKeysFilesIndex().);
306
		//wmm.saveKeyModificationsInSources();
288
//		WorkspaceMessagesManager wmm = new WorkspaceMessagesManager(false);
289
//		
290
//		for (PluginMessagesManager pmManager : wmm.getPluginMessages().values()) {
291
//			//System.out.println(pmManager.getProjectDirectory().getName());
292
//			if (pmManager.getProjectDirectory().getName().equals("org.txm.chartsengine.jfreechart.core")) {
293
//				System.out.println("INDEX jfc core="+pmManager.getUsedKeysFilesIndex());
294
//			}
295
//			if (!pmManager.getProjectDirectory().getName().equals("org.txm.chartsengine.core")) continue;
296
//
297
//
298
////			System.out.println("KEYS="+pmManager.getMessageKeys());
299
//			keysNormalizer.normalize(pmManager);
300
////			System.out.println("KEYS2="+pmManager.getMessageKeys());
301
////			System.out.println("MODIFS="+pmManager.getKeyModifications());
302
//			//pmManager.saveChanges(true); // mode homme
303
//
304
//			//pmManager.saveChanges(false);
305
//			
306
//			System.out.println("INDEX="+pmManager.getUsedKeysFilesIndex());
307
//		}
308
//
309
//		//System.out.println("FULLINDEX="+wmm.getUsedKeysFilesIndex().);
310
//		//wmm.saveKeyModificationsInSources();
307 311
	}
308 312
}

Also available in: Unified diff