Révision 1253
| tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/NormalizeKeys.java (revision 1253) | ||
|---|---|---|
| 60 | 60 |
System.err.println("NormalizeKeys.normalize(): warning: empty string for key: " + key);
|
| 61 | 61 |
continue; |
| 62 | 62 |
} |
| 63 |
String oldKey = key; |
|
| 64 |
String newKey = normalize(messages.get(key)); |
|
| 65 |
pmManager.renameKey(oldKey, newKey); |
|
| 63 | 66 |
|
| 64 |
messages.put(normalize(messages.get(key)), messages.get(key)); |
|
| 67 |
//messages.put(normalize(messages.get(key)), messages.get(key)); |
|
| 68 |
|
|
| 69 |
|
|
| 65 | 70 |
//messages.removeByKey(key); |
| 66 | 71 |
} |
| 67 | 72 |
|
| ... | ... | |
| 177 | 182 |
// tests |
| 178 | 183 |
keysNormalizer.normalize(pmManager); |
| 179 | 184 |
|
| 180 |
pmManager.dump(pmManager.getMessagesForLang(""));
|
|
| 185 |
//pmManager.dump(pmManager.getMessagesForLang(""));
|
|
| 186 |
pmManager.dumpKeysReplacements(); |
|
| 181 | 187 |
|
| 188 |
|
|
| 182 | 189 |
System.out.println("NormalizeKeys.main(): terminated.");
|
| 183 | 190 |
|
| 184 | 191 |
// HashSet<String> strings = new HashSet<String>(); |
| tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessages.java (revision 1253) | ||
|---|---|---|
| 471 | 471 |
public void renameKey(String oldName, String newName) {
|
| 472 | 472 |
|
| 473 | 473 |
if (!messageKeys.contains(oldName)) {
|
| 474 |
System.out.println("Missing key="+oldName+" aborting renaming to "+newName+".");
|
|
| 474 |
System.err.println("Missing key="+oldName+" aborting renaming to "+newName+".");
|
|
| 475 | 475 |
return; |
| 476 | 476 |
} |
| 477 | 477 |
|
| ... | ... | |
| 524 | 524 |
} |
| 525 | 525 |
} |
| 526 | 526 |
|
| 527 |
/** |
|
| 528 |
* Dumps the specified HashMap<String, String> to standard output. |
|
| 529 |
* @param messages |
|
| 530 |
*/ |
|
| 531 |
public void dump(HashMap<String, String> messages) {
|
|
| 532 |
for (String key : messages.keySet()) {
|
|
| 533 |
System.out.println("PluginMessages.dump(): " + key + "=" + messages.get(key));
|
|
| 534 |
} |
|
| 535 |
} |
|
| 527 | 536 |
|
| 537 |
/** |
|
| 538 |
* Dumps the keys replacements table. |
|
| 539 |
*/ |
|
| 540 |
public void dumpKeysReplacements() {
|
|
| 541 |
System.out.println("PluginMessages.dumpKeysReplacements(): keys replacements table");
|
|
| 542 |
this.dump(this.keyModifications); |
|
| 543 |
} |
|
| 528 | 544 |
|
| 545 |
|
|
| 529 | 546 |
/** |
| 530 | 547 |
* |
| 531 | 548 |
* @param args |
Formats disponibles : Unified diff