Index: translatedfiles/tools/src/org/netbeans/modules/translatedfiles/tools/Grep.java =================================================================== RCS file: /cvs/translatedfiles/tools/src/org/netbeans/modules/translatedfiles/tools/Grep.java,v retrieving revision 1.1 diff -u -r1.1 Grep.java --- translatedfiles/tools/src/org/netbeans/modules/translatedfiles/tools/Grep.java 11 Feb 2003 14:48:30 -0000 1.1 +++ translatedfiles/tools/src/org/netbeans/modules/translatedfiles/tools/Grep.java 19 Jun 2003 21:12:48 -0000 @@ -5,13 +5,14 @@ * 1.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is available at http://www.sun.com/ * -* The Original Code is the Translatedfiles module. +* The Original Code is the Tools for Translatedfiles module. * The Initial Developers of the Original Code are Keiichi Oono, and teik. * Portions created by Keiichi Oono are Copyright (C) 2003. * Portions created by teik are Copyright (C) 2003. +* Portions Copyright 2003 Maxym Mykhalchuk . * All Rights Reserved. * -* Contributor(s): Keiichi Oono, teik. +* Contributor(s): Keiichi Oono, teik, Maxym Mykhalchuk. */ package org.netbeans.modules.translatedfiles.tools; @@ -64,12 +65,16 @@ if (((lineStr.indexOf(key+"=") >= 0) || isMultipleLine == true) && hitCounter < 2) { if (lineStr.startsWith("#")) { - enMessage.append( - lineStr.substring(lineStr.indexOf("=") + 1)); + if (isMultipleLine) + enMessage.append(lineStr.substring(2)); + else + enMessage.append(lineStr.substring(lineStr.indexOf("=") + 1)); enMessage.append(LINE_SEP); } else { - t9nMessage.append( - lineStr.substring(lineStr.indexOf("=") + 1)); + if (isMultipleLine) + t9nMessage.append(lineStr); + else + t9nMessage.append(lineStr.substring(lineStr.indexOf("=") + 1)); t9nMessage.append(LINE_SEP); } if (lineStr.endsWith("\\")) { Index: translatedfiles/tools/src/org/netbeans/modules/translatedfiles/tools/Merge.java =================================================================== RCS file: /cvs/translatedfiles/tools/src/org/netbeans/modules/translatedfiles/tools/Merge.java,v retrieving revision 1.1.8.1 diff -u -r1.1.8.1 Merge.java --- translatedfiles/tools/src/org/netbeans/modules/translatedfiles/tools/Merge.java 13 Mar 2003 23:50:13 -0000 1.1.8.1 +++ translatedfiles/tools/src/org/netbeans/modules/translatedfiles/tools/Merge.java 19 Jun 2003 21:12:49 -0000 @@ -9,9 +9,10 @@ * The Initial Developers of the Original Code are Keiichi Oono, and teik. * Portions created by Keiichi Oono are Copyright (C) 2003. * Portions created by teik are Copyright (C) 2003. +* Portions Copyright 2003 Maxym Mykhalchuk . * All Rights Reserved. * -* Contributor(s): Keiichi Oono, teik. +* Contributor(s): Keiichi Oono, teik, Maxym Mykhalchuk. */ package org.netbeans.modules.translatedfiles.tools; @@ -49,8 +50,8 @@ Grep gp = new Grep(); while (enFile.ready()) { String readBuf = enFile.readLine(); - // If length is '0', it's a blank line. - if(readBuf.length() == 0) { + // If length of trimmed string is '0', it's a blank line. + if(readBuf.trim().length() == 0) { sb.append(LINE_SEP); continue; } @@ -60,15 +61,17 @@ } else { enLine = readBuf; } - if (enLine.endsWith("\\")) { + // no trim here, but checking if it's a comment + // if it is, then the line doesn't continue + if (enLine.endsWith("\\") && (!enLine.trim().startsWith("#"))) { contFlag = true; continue; } else { contFlag = false; } - // If the liens comment, return that line without any changes. - if (enLine.startsWith("#")) { + // If the line is a comment, return that line without any changes. + if (enLine.trim().startsWith("#")) { sb.append(enLine); sb.append(LINE_SEP); } else { @@ -83,10 +86,9 @@ sb.append(enLine); sb.append(LINE_SEP); } else { - String EngMsg = - grepResult.enMessage.replaceAll("# ", ""); + String EngMsg = grepResult.enMessage; String LocMsg = enLine.substring( - enLine.indexOf("=") + 1) + LINE_SEP; + enLine.indexOf("=") + 1) + LINE_SEP; if (!EngMsg.equals(LocMsg)) { sb.append("# MODIFIED !!!"); sb.append(LINE_SEP);