This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 34265
Collapse All | Expand All

(-)translatedfiles/tools/src/org/netbeans/modules/translatedfiles/tools/Grep.java (-6 / +11 lines)
Lines 5-17 Link Here
5
* 1.0 (the "License"). You may not use this file except in compliance with
5
* 1.0 (the "License"). You may not use this file except in compliance with
6
* the License. A copy of the License is available at http://www.sun.com/
6
* the License. A copy of the License is available at http://www.sun.com/
7
* 
7
* 
8
* The Original Code is the Translatedfiles module.
8
* The Original Code is the Tools for Translatedfiles module.
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 64-75 Link Here
64
            if (((lineStr.indexOf(key+"=") >= 0) || isMultipleLine == true)
65
            if (((lineStr.indexOf(key+"=") >= 0) || isMultipleLine == true)
65
                    && hitCounter < 2) {
66
                    && hitCounter < 2) {
66
                if (lineStr.startsWith("#")) {
67
                if (lineStr.startsWith("#")) {
67
                    enMessage.append(
68
                    if (isMultipleLine)
68
                    lineStr.substring(lineStr.indexOf("=") + 1));
69
                        enMessage.append(lineStr.substring(2));
70
                    else
71
                        enMessage.append(lineStr.substring(lineStr.indexOf("=") + 1));
69
                    enMessage.append(LINE_SEP);
72
                    enMessage.append(LINE_SEP);
70
                } else {
73
                } else {
71
                    t9nMessage.append(
74
                    if (isMultipleLine)
72
                    lineStr.substring(lineStr.indexOf("=") + 1));
75
                        t9nMessage.append(lineStr);
76
                    else
77
                        t9nMessage.append(lineStr.substring(lineStr.indexOf("=") + 1));
73
                    t9nMessage.append(LINE_SEP);
78
                    t9nMessage.append(LINE_SEP);
74
                }
79
                }
75
                if (lineStr.endsWith("\\")) {
80
                if (lineStr.endsWith("\\")) {
(-)translatedfiles/tools/src/org/netbeans/modules/translatedfiles/tools/Merge.java (-9 / +11 lines)
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);

Return to bug 34265