Révision 1329
tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/NormalizeKeys.java (revision 1329) | ||
---|---|---|
117 | 117 |
newKey = newKeyOrig+"_"+(c++); |
118 | 118 |
} |
119 | 119 |
|
120 |
if (key.equals(newKeyOrig)) { // finally nothing to do |
|
121 |
continue; |
|
122 |
} |
|
123 |
|
|
120 | 124 |
pmManager.renameKey(key, newKey); |
121 | 125 |
normalized.add(key + " => " + newKey); |
122 | 126 |
// } |
... | ... | |
150 | 154 |
} |
151 | 155 |
|
152 | 156 |
str = str.trim(); |
157 |
|
|
158 |
if (str.length() == 0) return "EMPTY"; |
|
153 | 159 |
|
154 | 160 |
// replace the parameters binding |
155 | 161 |
str = str.replaceAll("(\\{[0-9]})", "P$1"); |
156 | 162 |
|
157 | 163 |
// special replacements |
158 |
str = str.replaceAll("%", "Percent"); |
|
159 |
str = str.replaceAll("=", "Equals"); |
|
160 |
str = str.replaceAll("@", "At"); |
|
161 |
//str = str.replaceAll("&", "Amp"); |
|
164 |
str = str.replace("%", "Percent"); |
|
165 |
str = str.replace("~", "Tild"); |
|
166 |
str = str.replace("=", "Equals"); |
|
167 |
str = str.replace("@", "At"); |
|
168 |
str = str.replace("&", "Amp"); |
|
169 |
str = str.replace("<", "Inf"); |
|
170 |
str = str.replace(">", "Sup"); |
|
171 |
str = str.replace("+", "Plus"); |
|
162 | 172 |
|
163 | 173 |
// remove all special chars |
164 | 174 |
str = str.replaceAll("[^a-zA-Z0-9 ]", "").trim(); |
165 | 175 |
|
166 |
// empty string
|
|
176 |
// the message contains only special chars
|
|
167 | 177 |
if(str.length() == 0) { |
168 | 178 |
//System.err.println("NormalizeKeys.normalize(): warning: empty string."); |
169 | 179 |
return ""; |
Formats disponibles : Unified diff