Révision 1316
tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/NormalizeKeys.java (revision 1316) | ||
---|---|---|
150 | 150 |
str = str.replaceAll("(\\{[0-9]})", "P$1"); |
151 | 151 |
|
152 | 152 |
// special replacements |
153 |
str = str.replaceAll("%", "percent"); |
|
154 |
str = str.replaceAll("=", "equals"); |
|
153 |
str = str.replaceAll("%", "Percent"); |
|
154 |
str = str.replaceAll("=", "Equals"); |
|
155 |
str = str.replaceAll("@", "At"); |
|
155 | 156 |
|
156 | 157 |
// remove all special chars |
157 | 158 |
str = str.replaceAll("[^a-zA-Z0-9 ]", "").trim(); |
... | ... | |
196 | 197 |
} |
197 | 198 |
|
198 | 199 |
// java variable can not start by a number or be a java keyword |
199 |
if(str.matches(javaKeyWords) || str.matches("^[0-9].*?$")) {
|
|
200 |
if(str.matches(javaKeyWords) || str.matches("^[0-9].*$")) { |
|
200 | 201 |
str = "_" + str; |
201 | 202 |
} |
202 | 203 |
|
Formats disponibles : Unified diff