Revision 7014 trunk/libraries/libInternationalization/src-utils/org/gvsig/i18n/utils/Keys.java
Keys.java | ||
---|---|---|
214 | 214 |
String key; |
215 | 215 |
File dir = new File(directory); |
216 | 216 |
File files[] = dir.listFiles(); |
217 |
int lineNumber; |
|
217 | 218 |
if (files!=null) { |
218 | 219 |
|
219 | 220 |
//Pattern keyPattern1 = Pattern.compile("(PluginServices|Messages)\\.(getText|getString|get)\\(.*\"(.*)\".*\\)"); |
220 | 221 |
Pattern keyPattern1 = Pattern.compile("(PluginServices|Messages)\\.(getText|getString|get)\\([^\"\\)]*\"([^\"]*)\"[^\\)]*\\)"); |
222 |
Pattern partialKeyPattern1 = Pattern.compile("(PluginServices|Messages)\\.(getText|getString|get)\\([^\\)]*"); |
|
221 | 223 |
|
222 | 224 |
Matcher keyMatcher1 = keyPattern1.matcher(""); |
225 |
Matcher partialKeyMatcher1 = partialKeyPattern1.matcher(""); |
|
223 | 226 |
|
224 | 227 |
for (int i=0; i<files.length; i++) { |
225 | 228 |
if (files[i].isDirectory()) { |
... | ... | |
229 | 232 |
//[Messages.]getText(...) |
230 | 233 |
// Pattern PsPattern = Pattern.compile("(Messages\\.)*getText\\(.*\"(.*)\".*\\)"); |
231 | 234 |
Pattern PsPattern = Pattern.compile("(Messages\\.)*getText\\([^\"\\)]*\"([^\"]*)\"[^\\)]*\\)"); |
235 |
Pattern PsPartialPattern = Pattern.compile("(Messages\\.)*getText\\([^\\)]*"); |
|
232 | 236 |
Matcher PsMatcher = PsPattern.matcher(""); |
237 |
Matcher PsPartialMatcher = PsPartialPattern.matcher(""); |
|
233 | 238 |
|
234 | 239 |
FileInputStream fis=null; |
235 | 240 |
try { |
... | ... | |
245 | 250 |
|
246 | 251 |
String line = null; |
247 | 252 |
try { |
253 |
lineNumber=1; |
|
248 | 254 |
while((line = currentFile.readLine()) != null) { |
249 | 255 |
PsMatcher.reset(line); |
256 |
PsPartialMatcher.reset(line); |
|
257 |
|
|
250 | 258 |
while (PsMatcher.find()) { |
251 | 259 |
key = PsMatcher.group(2); |
252 | 260 |
if (!key.equals("")) |
253 | 261 |
keys.add(key); |
254 | 262 |
} |
263 |
|
|
264 |
while (PsPartialMatcher.find()) { |
|
265 |
if (PsPartialMatcher.end()==line.length()) { |
|
266 |
System.out.println("FileName: "+files[i].getCanonicalPath()+"; lineNumber: "+lineNumber); |
|
267 |
System.out.println("text: "+line); |
|
268 |
} |
|
269 |
} |
|
270 |
lineNumber++; |
|
255 | 271 |
} |
256 | 272 |
currentFile.close(); |
257 | 273 |
} catch (IOException e) { |
... | ... | |
277 | 293 |
|
278 | 294 |
String line = null; |
279 | 295 |
try { |
296 |
lineNumber=1; |
|
280 | 297 |
while((line = currentFile.readLine()) != null) { |
281 | 298 |
keyMatcher1.reset(line); |
282 | 299 |
while (keyMatcher1.find()) { |
... | ... | |
284 | 301 |
if (!key.equals("")) |
285 | 302 |
keys.add(key); |
286 | 303 |
} |
304 |
partialKeyMatcher1.reset(line); |
|
305 |
while (partialKeyMatcher1.find()) { |
|
306 |
if (partialKeyMatcher1.end()==line.length()) { |
|
307 |
System.out.println("FileName: "+files[i].getCanonicalPath()+"; lineNumber: "+lineNumber); |
|
308 |
System.out.println("text: "+line); |
|
309 |
} |
|
310 |
} |
|
311 |
lineNumber++; |
|
287 | 312 |
} |
288 | 313 |
currentFile.close(); |
289 | 314 |
} catch (IOException e) { |
Also available in: Unified diff