Lines 9-17
Link Here
|
9 |
* The Initial Developers of the Original Code are Keiichi Oono, and teik. |
9 |
* The Initial Developers of the Original Code are Keiichi Oono, and teik. |
10 |
* Portions created by Keiichi Oono are Copyright (C) 2003. |
10 |
* Portions created by Keiichi Oono are Copyright (C) 2003. |
11 |
* Portions created by teik are Copyright (C) 2003. |
11 |
* Portions created by teik are Copyright (C) 2003. |
|
|
12 |
* Portions Copyright 2003 Maxym Mykhalchuk <mihmax@netbeans.org>. |
12 |
* All Rights Reserved. |
13 |
* All Rights Reserved. |
13 |
* |
14 |
* |
14 |
* Contributor(s): Keiichi Oono, teik. |
15 |
* Contributor(s): Keiichi Oono, teik, Maxym Mykhalchuk. |
15 |
*/ |
16 |
*/ |
16 |
|
17 |
|
17 |
package org.netbeans.modules.translatedfiles.tools; |
18 |
package org.netbeans.modules.translatedfiles.tools; |
Lines 49-56
Link Here
|
49 |
Grep gp = new Grep(); |
50 |
Grep gp = new Grep(); |
50 |
while (enFile.ready()) { |
51 |
while (enFile.ready()) { |
51 |
String readBuf = enFile.readLine(); |
52 |
String readBuf = enFile.readLine(); |
52 |
// If length is '0', it's a blank line. |
53 |
// If length of trimmed string is '0', it's a blank line. |
53 |
if(readBuf.length() == 0) { |
54 |
if(readBuf.trim().length() == 0) { |
54 |
sb.append(LINE_SEP); |
55 |
sb.append(LINE_SEP); |
55 |
continue; |
56 |
continue; |
56 |
} |
57 |
} |
Lines 60-74
Link Here
|
60 |
} else { |
61 |
} else { |
61 |
enLine = readBuf; |
62 |
enLine = readBuf; |
62 |
} |
63 |
} |
63 |
if (enLine.endsWith("\\")) { |
64 |
// no trim here, but checking if it's a comment |
|
|
65 |
// if it is, then the line doesn't continue |
66 |
if (enLine.endsWith("\\") && (!enLine.trim().startsWith("#"))) { |
64 |
contFlag = true; |
67 |
contFlag = true; |
65 |
continue; |
68 |
continue; |
66 |
} else { |
69 |
} else { |
67 |
contFlag = false; |
70 |
contFlag = false; |
68 |
} |
71 |
} |
69 |
|
72 |
|
70 |
// If the liens comment, return that line without any changes. |
73 |
// If the line is a comment, return that line without any changes. |
71 |
if (enLine.startsWith("#")) { |
74 |
if (enLine.trim().startsWith("#")) { |
72 |
sb.append(enLine); |
75 |
sb.append(enLine); |
73 |
sb.append(LINE_SEP); |
76 |
sb.append(LINE_SEP); |
74 |
} else { |
77 |
} else { |
Lines 83-92
Link Here
|
83 |
sb.append(enLine); |
86 |
sb.append(enLine); |
84 |
sb.append(LINE_SEP); |
87 |
sb.append(LINE_SEP); |
85 |
} else { |
88 |
} else { |
86 |
String EngMsg = |
89 |
String EngMsg = grepResult.enMessage; |
87 |
grepResult.enMessage.replaceAll("# ", ""); |
|
|
88 |
String LocMsg = enLine.substring( |
90 |
String LocMsg = enLine.substring( |
89 |
enLine.indexOf("=") + 1) + LINE_SEP; |
91 |
enLine.indexOf("=") + 1) + LINE_SEP; |
90 |
if (!EngMsg.equals(LocMsg)) { |
92 |
if (!EngMsg.equals(LocMsg)) { |
91 |
sb.append("# MODIFIED !!!"); |
93 |
sb.append("# MODIFIED !!!"); |
92 |
sb.append(LINE_SEP); |
94 |
sb.append(LINE_SEP); |