Multi fixes for L10N-framework #87136#

This commit is contained in:
Nils Fuhrmann 2001-06-27 11:08:41 +00:00
parent 75eba45b2b
commit dcf06ffaec
4 changed files with 56 additions and 30 deletions

View file

@ -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 {

View file

@ -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++;

View file

@ -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();

View file

@ -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
OBJFILES= \
$(OBJ)$/export.obj \
$(OBJ)$/export2.obj \
$(OBJ)$/merge.obj \
$(OBJ)$/wrdtrans.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)$/export.obj \
$(OBJ)$/wrdtrans.obj \
$(OBJ)$/merge.obj \
$(OBJ)$/wtratree.obj \
$(OBJ)$/wtranode.obj \
$(OBJ)$/srciter.obj
APP1OBJS= $(OBJ)$/src_yy.obj $(OBJ)$/utf8conv.obj
APP1STDLIBS+=$(BTSTRPLIB) $(STATIC_LIBS)
APP1LIBS+= $(LB)$/$(TARGET).lib
APP1DEPN= $(OBJ)$/src_yy.obj $(LB)$/$(TARGET).lib