Révision 1262
tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/NormalizeKeys.java (revision 1262) | ||
---|---|---|
13 | 13 |
* Normalizes the keys using the words of the message sentence. |
14 | 14 |
* eg. : "Error while computing {0}." => errorWhileComputing0 |
15 | 15 |
* |
16 |
* |
|
17 | 16 |
* @author mdecorde |
18 | 17 |
* @author sjacquot |
19 | 18 |
* |
... | ... | |
70 | 69 |
continue; |
71 | 70 |
} |
72 | 71 |
|
73 |
String newKey = normalize(messages.get(key)); |
|
72 |
String newKeyOrig = normalize(messages.get(key)); |
|
73 |
String newKey = ""+newKeyOrig; |
|
74 |
int c = 2; |
|
75 |
while (pmManager.getMessageKeys().contains(newKey)) { |
|
76 |
newKey += newKeyOrig+"_"+(c++); |
|
77 |
} |
|
78 |
|
|
74 | 79 |
pmManager.renameKey(key, newKey); |
80 |
|
|
75 | 81 |
n++; |
76 | 82 |
} |
77 | 83 |
|
... | ... | |
212 | 218 |
// } |
213 | 219 |
|
214 | 220 |
NormalizeKeys keysNormalizer = new NormalizeKeys(false); |
221 |
|
|
215 | 222 |
WorkspaceMessagesManager wmm = new WorkspaceMessagesManager(); |
216 | 223 |
for (PluginMessages pm : wmm.getPluginMessages().values()) { |
217 | 224 |
keysNormalizer.normalize(pm); |
218 | 225 |
} |
219 |
wmm.saveKeyModificationsInSources(); |
|
226 |
|
|
227 |
//wmm.saveKeyModificationsInSources(); |
|
220 | 228 |
} |
221 | 229 |
} |
tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/WorkspaceMessagesManager.java (revision 1262) | ||
---|---|---|
206 | 206 |
|
207 | 207 |
for (String oldKey : keys) { |
208 | 208 |
if (index.containsKey(oldKey)) { |
209 |
System.out.println("REPLACE IN SOURCE FILE THE KEY="+oldKey+" BY KEY="+modifications.get(oldKey)); |
|
210 |
updated.add(oldKey); |
|
209 |
TreeSet<File> files = index.get(oldKey); |
|
210 |
if (files.size() > 0) { |
|
211 |
System.out.println("REPLACE IN SOURCE FILES THE KEY="+oldKey+" BY KEY="+modifications.get(oldKey)); |
|
212 |
updated.add(oldKey); |
|
213 |
} |
|
211 | 214 |
} |
212 | 215 |
} |
213 | 216 |
} |
Formats disponibles : Unified diff