summaryrefslogtreecommitdiff
path: root/transex3
diff options
context:
space:
mode:
authorNils Fuhrmann <nf@openoffice.org>2001-06-27 11:08:41 +0000
committerNils Fuhrmann <nf@openoffice.org>2001-06-27 11:08:41 +0000
commitdcf06ffaece84f33fb642cd2274b2d75bf9e7cf7 (patch)
tree670063c79b7acd75cd1ccd1a6d14357661178acd /transex3
parent75eba45b2b16eb869b8ea4a8d60b8026127680f5 (diff)
Multi fixes for L10N-framework #87136#
Diffstat (limited to 'transex3')
-rw-r--r--transex3/source/lngex.cxx18
-rw-r--r--transex3/source/lngmerge.cxx20
-rw-r--r--transex3/source/localize.cxx24
-rw-r--r--transex3/source/makefile.mk24
4 files changed, 56 insertions, 30 deletions
diff --git a/transex3/source/lngex.cxx b/transex3/source/lngex.cxx
index 5a861217c444..fe5d89db7c03 100644
--- a/transex3/source/lngex.cxx
+++ b/transex3/source/lngex.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: lngex.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: nf $ $Date: 2001-06-11 13:49:22 $
+ * last change: $Author: nf $ $Date: 2001-06-27 12:08:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -104,22 +104,22 @@ BOOL ParseCommandLine( int argc, char* argv[])
// parse command line
for( int i = 1; i < argc; i++ ) {
- if (( ByteString( argv[ i ]) == "-i" ) || ( argv[ i ] == "-I" )) {
+ if ( ByteString( argv[ i ]).ToUpperAscii() == "-I" ) {
nState = STATE_INPUT; // next tokens specifies source files
}
- else if (( ByteString( argv[ i ]) == "-o" ) || ( argv[ i ] == "-O" )) {
+ else if ( ByteString( argv[ i ]).ToUpperAscii() == "-O" ) {
nState = STATE_OUTPUT; // next token specifies the dest file
}
- else if (( ByteString( argv[ i ]) == "-p" ) || ( argv[ i ] == "-P" )) {
+ else if ( ByteString( argv[ i ]).ToUpperAscii() == "-P" ) {
nState = STATE_PRJ; // next token specifies the cur. project
}
- else if (( ByteString( argv[ i ]) == "-r" ) || ( argv[ i ] == "-R" )) {
+ else if ( ByteString( argv[ i ]).ToUpperAscii() == "-R" ) {
nState = STATE_ROOT; // next token specifies path to project root
}
- else if (( ByteString( argv[ i ]) == "-m" ) || ( argv[ i ] == "-M" )) {
+ else if ( ByteString( argv[ i ]).ToUpperAscii() == "-M" ) {
nState = STATE_MERGESRC; // next token specifies the merge database
}
- else if (( ByteString( argv[ i ]) == "-e" ) || ( argv[ i ] == "-E" )) {
+ else if ( ByteString( argv[ i ]).ToUpperAscii() == "-E" ) {
nState = STATE_ERRORLOG;
bErrorLog = FALSE;
}
@@ -131,7 +131,7 @@ BOOL ParseCommandLine( int argc, char* argv[])
nState = STATE_UTF8;
bUTF8 = FALSE;
}
- else if (( ByteString( argv[ i ]) == "-l" ) || ( argv[ i ] == "-L" )) {
+ else if ( ByteString( argv[ i ]).ToUpperAscii() == "-L" ) {
nState = STATE_LANGUAGES;
}
else {
diff --git a/transex3/source/lngmerge.cxx b/transex3/source/lngmerge.cxx
index 3949bfc26b78..2066f7c3c69e 100644
--- a/transex3/source/lngmerge.cxx
+++ b/transex3/source/lngmerge.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: lngmerge.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: nf $ $Date: 2001-06-11 13:49:22 $
+ * last change: $Author: nf $ $Date: 2001-06-27 12:08:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -294,6 +294,8 @@ BOOL LngParser::Merge(
// read languages
bGroup = FALSE;
+ ByteString sLanguagesDone;
+
while ( nPos < pLines->Count() && !bGroup ) {
ByteString sLine( *pLines->GetObject( nPos ));
sLine.EraseLeadingChars( ' ' );
@@ -306,18 +308,23 @@ BOOL LngParser::Merge(
sGroup.EraseTrailingChars( ' ' );
bGroup = TRUE;
nPos ++;
+ sLanguagesDone = "";
}
else if ( sLine.GetTokenCount( '=' ) > 1 ) {
ByteString sLang = sLine.GetToken( 0, '=' );
sLang.EraseLeadingChars( ' ' );
sLang.EraseTrailingChars( ' ' );
- if ( !sLang.IsNumericAscii()) {
+ ByteString sSearch( ";" );
+ sSearch += sLang;
+ sSearch += ";";
+
+ if (( !sLang.IsNumericAscii() || sLanguagesDone.Search( sSearch ) != STRING_NOTFOUND )) {
pLines->Remove( nPos );
}
else if (( MergeDataFile::GetLangIndex( sLang.ToInt32()) < LANGUAGES ) &&
( pEntrys ) &&
- ( LANGUAGE_ALLOWED( sLang.ToInt32())))
+ ( LANGUAGE_ALLOWED( Export::GetLangIndex( sLang.ToInt32()))))
{
// this is a valid text line
USHORT nIndex = MergeDataFile::GetLangIndex( sLang.ToInt32());
@@ -338,10 +345,13 @@ BOOL LngParser::Merge(
}
nLastLangPos = nPos;
nPos ++;
+ sLanguagesDone += sSearch;
}
- else
+ else {
nLastLangPos = nPos;
nPos ++;
+ sLanguagesDone += sSearch;
+ }
}
else
nPos++;
diff --git a/transex3/source/localize.cxx b/transex3/source/localize.cxx
index a5197c22cdb3..4940d89bdc47 100644
--- a/transex3/source/localize.cxx
+++ b/transex3/source/localize.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: localize.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: nf $ $Date: 2001-06-11 13:49:22 $
+ * last change: $Author: nf $ $Date: 2001-06-27 12:08:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,8 @@
#include <bootstrp/command.hxx>
#include <stdio.h>
+// #define EHAM02_TEST
+
//
// SourceTreeLocalizer
//
@@ -287,8 +289,24 @@ void SourceTreeLocalizer::WorkOnFile(
ByteString sLine;
while ( !aSDFIn.IsEof()) {
aSDFIn.ReadLine( sLine );
- if ( sLine.Len())
+ if ( sLine.Len()) {
+
+#ifdef EHAM02_TEST
+ if ( sLine.GetToken( 9, '\t' ) == "99" ) {
+ ByteString sTmp;
+ for ( USHORT i = 0; i < sLine.GetTokenCount( '\t' ); i++ ) {
+ if ( i == 10 )
+ sTmp += "X_";
+ sTmp += sLine.GetToken( i, '\t' );
+ sTmp += "\t";
+ }
+ sTmp.EraseTrailingChars( '\t' );
+ sLine = sTmp;
+ }
+#endif
+
aSDF.WriteLine( sLine );
+ }
}
aSDFIn.Close();
diff --git a/transex3/source/makefile.mk b/transex3/source/makefile.mk
index 6cb43bffa0eb..f89835aa74e4 100644
--- a/transex3/source/makefile.mk
+++ b/transex3/source/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.15 $
+# $Revision: 1.16 $
#
-# last change: $Author: nf $ $Date: 2001-06-26 13:18:03 $
+# last change: $Author: nf $ $Date: 2001-06-27 12:08:41 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -76,21 +76,19 @@ CDEFS+= -DYY_NEVER_INTERACTIVE=1
# --- Files --------------------------------------------------------
-OBJFILES= \
- $(OBJ)$/utf8conv.obj \
- $(OBJ)$/export2.obj
-
-# extractor and merger for *.src and *.hrc
-APP1TARGET= $(TARGET)
-APP1STACK= 16000
-APP1OBJS= \
- $(OBJ)$/src_yy.obj \
- $(OBJ)$/export.obj \
+OBJFILES= \
+ $(OBJ)$/export.obj \
+ $(OBJ)$/export2.obj \
+ $(OBJ)$/merge.obj \
$(OBJ)$/wrdtrans.obj \
- $(OBJ)$/merge.obj \
$(OBJ)$/wtratree.obj \
$(OBJ)$/wtranode.obj \
$(OBJ)$/srciter.obj
+
+# extractor and merger for *.src and *.hrc
+APP1TARGET= $(TARGET)
+APP1STACK= 16000
+APP1OBJS= $(OBJ)$/src_yy.obj $(OBJ)$/utf8conv.obj
APP1STDLIBS+=$(BTSTRPLIB) $(STATIC_LIBS)
APP1LIBS+= $(LB)$/$(TARGET).lib
APP1DEPN= $(OBJ)$/src_yy.obj $(LB)$/$(TARGET).lib