summaryrefslogtreecommitdiff
path: root/development/translation/opie-lupdate
authorzecke <zecke>2004-01-09 19:13:35 (UTC)
committer zecke <zecke>2004-01-09 19:13:35 (UTC)
commit56bb9961db1158250bbfe971f4556b56c0bd6581 (patch) (side-by-side diff)
treea4f40da98f695b5aadd845b68aaab41ac3d81826 /development/translation/opie-lupdate
parent6875988077013544246ae0df7cc2e5d538a7f152 (diff)
downloadopie-56bb9961db1158250bbfe971f4556b56c0bd6581.zip
opie-56bb9961db1158250bbfe971f4556b56c0bd6581.tar.gz
opie-56bb9961db1158250bbfe971f4556b56c0bd6581.tar.bz2
Update lupdate and shared to Qt3.3 qt-copy sources
Some special replacement for $$(OPIEDIR) to make ar_* happy
Diffstat (limited to 'development/translation/opie-lupdate') (more/less context) (show whitespace changes)
-rw-r--r--development/translation/opie-lupdate/fetchtr.cpp55
-rw-r--r--development/translation/opie-lupdate/main.cpp11
-rw-r--r--development/translation/opie-lupdate/merge.cpp6
-rw-r--r--development/translation/opie-lupdate/numberh.cpp24
-rw-r--r--development/translation/opie-lupdate/sametexth.cpp6
5 files changed, 82 insertions, 20 deletions
diff --git a/development/translation/opie-lupdate/fetchtr.cpp b/development/translation/opie-lupdate/fetchtr.cpp
index d1f5881..a137628 100644
--- a/development/translation/opie-lupdate/fetchtr.cpp
+++ b/development/translation/opie-lupdate/fetchtr.cpp
@@ -1,38 +1,44 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qt Linguist.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <metatranslator.h>
#include <qfile.h>
#include <qregexp.h>
#include <qstring.h>
#include <qtextstream.h>
#include <qvaluestack.h>
#include <qxml.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
/* qmake ignore Q_OBJECT */
static const char MagicComment[] = "TRANSLATOR ";
@@ -59,202 +65,223 @@ static QMap<QCString, int> lacks_Q_OBJECT;
RightBrace.
The 0 doesn't produce any token.
*/
enum { Tok_Eof, Tok_class, Tok_namespace, Tok_return, Tok_tr,
Tok_trUtf8, Tok_translate, Tok_Q_OBJECT, Tok_Ident,
Tok_Comment, Tok_String, Tok_Arrow, Tok_Colon,
Tok_Gulbrandsen, Tok_LeftBrace, Tok_RightBrace, Tok_LeftParen,
Tok_RightParen, Tok_Comma, Tok_Semicolon };
/*
The tokenizer maintains the following global variables. The names
should be self-explanatory.
*/
static QCString yyFileName;
static int yyCh;
static char yyIdent[128];
static size_t yyIdentLen;
static char yyComment[65536];
static size_t yyCommentLen;
static char yyString[16384];
static size_t yyStringLen;
static QValueStack<int> yySavedBraceDepth;
+static QValueStack<int> yySavedParenDepth;
static int yyBraceDepth;
static int yyParenDepth;
static int yyLineNo;
static int yyCurLineNo;
+static int yyBraceLineNo;
+static int yyParenLineNo;
// the file to read from (if reading from a file)
static FILE *yyInFile;
// the string to read from and current position in the string (otherwise)
static QString yyInStr;
static int yyInPos;
static int (*getChar)();
static int getCharFromFile()
{
int c = getc( yyInFile );
if ( c == '\n' )
yyCurLineNo++;
return c;
}
static int getCharFromString()
{
if ( yyInPos == (int) yyInStr.length() ) {
return EOF;
} else {
return yyInStr[yyInPos++].latin1();
}
}
static void startTokenizer( const char *fileName, int (*getCharFunc)() )
{
yyInPos = 0;
getChar = getCharFunc;
yyFileName = fileName;
yyCh = getChar();
yySavedBraceDepth.clear();
+ yySavedParenDepth.clear();
yyBraceDepth = 0;
yyParenDepth = 0;
yyCurLineNo = 1;
+ yyBraceLineNo = 1;
+ yyParenLineNo = 1;
}
static int getToken()
{
const char tab[] = "abfnrtv";
const char backTab[] = "\a\b\f\n\r\t\v";
uint n;
yyIdentLen = 0;
yyCommentLen = 0;
yyStringLen = 0;
while ( yyCh != EOF ) {
yyLineNo = yyCurLineNo;
if ( isalpha(yyCh) || yyCh == '_' ) {
do {
if ( yyIdentLen < sizeof(yyIdent) - 1 )
yyIdent[yyIdentLen++] = (char) yyCh;
yyCh = getChar();
} while ( isalnum(yyCh) || yyCh == '_' );
yyIdent[yyIdentLen] = '\0';
switch ( yyIdent[0] ) {
case 'Q':
if ( strcmp(yyIdent + 1, "_OBJECT") == 0 ) {
return Tok_Q_OBJECT;
} else if ( strcmp(yyIdent + 1, "T_TR_NOOP") == 0 ) {
return Tok_tr;
} else if ( strcmp(yyIdent + 1, "T_TRANSLATE_NOOP") == 0 ) {
return Tok_translate;
}
break;
case 'T':
// TR() for when all else fails
if ( qstricmp(yyIdent + 1, "R") == 0 )
return Tok_tr;
break;
case 'c':
if ( strcmp(yyIdent + 1, "lass") == 0 )
return Tok_class;
break;
+ case 'f':
+ /*
+ QTranslator::findMessage() has the same parameters as
+ QApplication::translate().
+ */
+ if ( strcmp(yyIdent + 1, "indMessage") == 0 )
+ return Tok_translate;
+ break;
+ case 'i':
+ /* FOR KDE APPS */
+ if ( strcmp( yyIdent + 1, "8n") == 0 )
+ return Tok_translate;
+ break;
case 'n':
if ( strcmp(yyIdent + 1, "amespace") == 0 )
return Tok_namespace;
break;
case 'r':
if ( strcmp(yyIdent + 1, "eturn") == 0 )
return Tok_return;
break;
case 's':
if ( strcmp(yyIdent + 1, "truct") == 0 )
return Tok_class;
break;
- case 'i':
- if( strcmp(yyIdent + 1, "18n") == 0 )
- return Tok_tr;
case 't':
if ( strcmp(yyIdent + 1, "r") == 0 ) {
return Tok_tr;
} else if ( qstrcmp(yyIdent + 1, "rUtf8") == 0 ) {
return Tok_trUtf8;
} else if ( qstrcmp(yyIdent + 1, "ranslate") == 0 ) {
return Tok_translate;
}
}
return Tok_Ident;
} else {
switch ( yyCh ) {
case '#':
/*
Early versions of lupdate complained about
unbalanced braces in the following code:
#ifdef ALPHA
while ( beta ) {
#else
while ( gamma ) {
#endif
delta;
}
The code contains, indeed, two opening braces for
one closing brace; yet there's no reason to panic.
The solution is to remember yyBraceDepth as it was
when #if, #ifdef or #ifndef was met, and to set
yyBraceDepth to that value when meeting #elif or
#else.
*/
do {
yyCh = getChar();
} while ( isspace(yyCh) && yyCh != '\n' );
switch ( yyCh ) {
case 'i':
yyCh = getChar();
if ( yyCh == 'f' ) {
// if, ifdef, ifndef
yySavedBraceDepth.push( yyBraceDepth );
+ yySavedParenDepth.push( yyParenDepth );
}
break;
case 'e':
yyCh = getChar();
if ( yyCh == 'l' ) {
// elif, else
- if ( !yySavedBraceDepth.isEmpty() )
+ if ( !yySavedBraceDepth.isEmpty() ) {
yyBraceDepth = yySavedBraceDepth.top();
+ yyParenDepth = yySavedParenDepth.top();
+ }
} else if ( yyCh == 'n' ) {
// endif
- if ( !yySavedBraceDepth.isEmpty() )
+ if ( !yySavedBraceDepth.isEmpty() ) {
yySavedBraceDepth.pop();
+ yySavedParenDepth.pop();
+ }
}
}
while ( isalnum(yyCh) || yyCh == '_' )
yyCh = getChar();
break;
case '/':
yyCh = getChar();
if ( yyCh == '/' ) {
do {
yyCh = getChar();
} while ( yyCh != EOF && yyCh != '\n' );
} else if ( yyCh == '*' ) {
bool metAster = FALSE;
bool metAsterSlash = FALSE;
while ( !metAsterSlash ) {
yyCh = getChar();
if ( yyCh == EOF ) {
fprintf( stderr,
"%s: Unterminated C++ comment starting at"
" line %d\n",
(const char *) yyFileName, yyLineNo );
yyComment[yyCommentLen] = '\0';
return Tok_Comment;
@@ -335,60 +362,68 @@ static int getToken()
yyCh = getChar();
if ( yyCh == '>' ) {
yyCh = getChar();
return Tok_Arrow;
}
break;
case ':':
yyCh = getChar();
if ( yyCh == ':' ) {
yyCh = getChar();
return Tok_Gulbrandsen;
}
return Tok_Colon;
case '\'':
yyCh = getChar();
if ( yyCh == '\\' )
yyCh = getChar();
do {
yyCh = getChar();
} while ( yyCh != EOF && yyCh != '\'' );
yyCh = getChar();
break;
case '{':
+ if (yyBraceDepth == 0)
+ yyBraceLineNo = yyCurLineNo;
yyBraceDepth++;
yyCh = getChar();
return Tok_LeftBrace;
case '}':
+ if (yyBraceDepth == 0)
+ yyBraceLineNo = yyCurLineNo;
yyBraceDepth--;
yyCh = getChar();
return Tok_RightBrace;
case '(':
+ if (yyParenDepth == 0)
+ yyParenLineNo = yyCurLineNo;
yyParenDepth++;
yyCh = getChar();
return Tok_LeftParen;
case ')':
+ if (yyParenDepth == 0)
+ yyParenLineNo = yyCurLineNo;
yyParenDepth--;
yyCh = getChar();
return Tok_RightParen;
case ',':
yyCh = getChar();
return Tok_Comma;
case ';':
yyCh = getChar();
return Tok_Semicolon;
default:
yyCh = getChar();
}
}
}
return Tok_Eof;
}
/*
The second part of this source file is the parser. It accomplishes
a very easy task: It finds all strings inside a tr() or translate()
call, and possibly finds out the context of the call. It supports
three cases: (1) the context is specified, as in
FunnyDialog::tr("Hello") or translate("FunnyDialog", "Hello");
(2) the call appears within an inlined function; (3) the call
@@ -600,56 +635,56 @@ static void parse( MetaTranslator *tor, const char *initialContext,
yyBraceDepth + 1 == (int) namespaces.count() )
namespaces.remove( namespaces.fromLast() );
if ( yyBraceDepth == (int) namespaces.count() ) {
if ( missing_Q_OBJECT ) {
if ( needs_Q_OBJECT.contains(functionContext) ) {
qWarning( "%s:%d: Class '%s' lacks Q_OBJECT macro",
(const char *) yyFileName, yyLineNo,
(const char *) functionContext );
} else {
lacks_Q_OBJECT.insert( functionContext, 0 );
}
}
functionContext = defaultContext;
missing_Q_OBJECT = FALSE;
}
yyTok = getToken();
break;
default:
yyTok = getToken();
}
}
if ( yyBraceDepth != 0 )
fprintf( stderr,
- "%s: Unbalanced braces in C++ code (or abuse of the C++"
+ "%s:%d: Unbalanced braces in C++ code (or abuse of the C++"
" preprocessor)\n",
- (const char *) yyFileName );
- if ( yyParenDepth != 0 )
+ (const char *)yyFileName, yyBraceLineNo );
+ else if ( yyParenDepth != 0 )
fprintf( stderr,
- "%s: Unbalanced parentheses in C++ code (or abuse of the C++"
+ "%s:%d: Unbalanced parentheses in C++ code (or abuse of the C++"
" preprocessor)\n",
- (const char *) yyFileName );
+ (const char *)yyFileName, yyParenLineNo );
}
void fetchtr_cpp( const char *fileName, MetaTranslator *tor,
const char *defaultContext, bool mustExist )
{
yyInFile = fopen( fileName, "r" );
if ( yyInFile == 0 ) {
if ( mustExist )
fprintf( stderr,
"lupdate error: Cannot open C++ source file '%s': %s\n",
fileName, strerror(errno) );
return;
}
startTokenizer( fileName, getCharFromFile );
parse( tor, 0, defaultContext );
fclose( yyInFile );
}
/*
In addition to C++, we support Qt Designer UI files.
*/
/*
diff --git a/development/translation/opie-lupdate/main.cpp b/development/translation/opie-lupdate/main.cpp
index ce65e7a..bf16fd7 100644
--- a/development/translation/opie-lupdate/main.cpp
+++ b/development/translation/opie-lupdate/main.cpp
@@ -41,48 +41,57 @@ extern void fetchtr_ui( const char *fileName, MetaTranslator *tor,
// defined in merge.cpp
extern void merge( MetaTranslator *tor, const MetaTranslator *virginTor,
bool verbose );
typedef QValueList<MetaTranslatorMessage> TML;
static const char* LUPDATE_VERSION = "0.1";
static void printUsage()
{
fprintf( stderr, "Usage:\n"
" opie-lupdate [options] project-file\n"
" opie-lupdate [options] source-files -ts ts-files\n"
"Options:\n"
" -opie The OPIE base dir if not supplied $OPIEDIR will be taken\n"
" -help Display this information and exit\n"
" -noobsolete\n"
" Drop all obsolete strings\n"
" -verbose\n"
" Explain what is being done\n"
" -version\n"
" Display the version of lupdate and exit\n" );
}
+/*static QString opie_escape( const QString& str ) {
+ QString ret = str.stripWhiteSpace();
+ qWarning(ret);
+ if ( ret.startsWith("$$(OPIEDIR)") )
+ ret = ret.replace("$$(OPIEDIR)", OPIE::self()->opieDir() );
+ qWarning(ret);
+ return ret;
+ }*/
+
static void updateTsFiles( const MetaTranslator& fetchedTor,
const QString& opiedir,
const QStringList& languages,
const QString& basename,
const QString& codec,
bool noObsolete, bool verbose )
{
QStringList::ConstIterator it = languages.begin();
for ( ; it != languages.end(); ++it ) {
QString fileName = opiedir + "/i18n/" + (*it) + "/" + basename;
MetaTranslator tor;
tor.load( fileName );
if ( !codec.isEmpty() )
tor.setCodec( codec );
if ( verbose )
fprintf( stderr, "Updating '%s'...\n", fileName.latin1() );
merge( &tor, &fetchedTor, verbose );
if ( noObsolete )
tor.stripObsoleteMessages();
tor.stripEmptyContexts();
if ( !tor.save(fileName) )
fprintf( stderr, "lupdate error: Cannot save '%s': %s\n",
fileName.latin1(), strerror(errno) );
}
@@ -129,49 +138,49 @@ int main( int argc, char **argv )
i++; // UGLY but we want to skip the next argument
continue;
}
numFiles++;
QString fullText;
QFile f( argv[i] );
if ( !f.open(IO_ReadOnly) ) {
fprintf( stderr, "lupdate error: Cannot open file '%s': %s\n",
argv[i], strerror(errno) );
return 1;
}
QTextStream t( &f );
fullText = t.read();
f.close();
fetchedTor = MetaTranslator();
codec.truncate( 0 );
tsFileNames.clear();
isLib = FALSE;
- QMap<QString, QString> tagMap = proFileTagMap( fullText );
+ QMap<QString, QString> tagMap = proFileTagMap( fullText, OPIE::self()->opieDir() );
QMap<QString, QString>::Iterator it;
for ( it = tagMap.begin(); it != tagMap.end(); ++it ) {
QStringList toks = QStringList::split( ' ', it.data() );
QStringList::Iterator t;
for ( t = toks.begin(); t != toks.end(); ++t ) {
if ( it.key() == "HEADERS" || it.key() == "SOURCES" ) {
fetchtr_cpp( *t, &fetchedTor, defaultContext, TRUE );
metSomething = TRUE;
} else if ( it.key() == "INTERFACES" ||
it.key() == "FORMS" ) {
fetchtr_ui( *t, &fetchedTor, defaultContext, TRUE );
fetchtr_cpp( *t + ".h", &fetchedTor, defaultContext,
FALSE );
metSomething = TRUE;
} else if ( it.key() == "TRANSLATIONS" ) {
// we do not care for that attribute anymore
//tsFileNames.append( *t );
metSomething = TRUE;
} else if ( it.key() == "CODEC" ) {
codec = (*t).latin1();
} else if ( it.key() == "TARGET" ) {
target = *t;
diff --git a/development/translation/opie-lupdate/merge.cpp b/development/translation/opie-lupdate/merge.cpp
index a96104e..3001d4b 100644
--- a/development/translation/opie-lupdate/merge.cpp
+++ b/development/translation/opie-lupdate/merge.cpp
@@ -1,38 +1,44 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qt Linguist.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <metatranslator.h>
// defined in numberh.cpp
extern void applyNumberHeuristic( MetaTranslator *tor, bool verbose );
// defined in sametexth.cpp
extern void applySameTextHeuristic( MetaTranslator *tor, bool verbose );
typedef QValueList<MetaTranslatorMessage> TML;
/*
Merges two MetaTranslator objects into the first one. The first one
is a set of source texts and translations for a previous version of
the internationalized program; the second one is a set of fresh
source texts newly extracted from the source code, without any
translation yet.
*/
void merge( MetaTranslator *tor, const MetaTranslator *virginTor, bool verbose )
diff --git a/development/translation/opie-lupdate/numberh.cpp b/development/translation/opie-lupdate/numberh.cpp
index f7b7bf8..2f12c3d 100644
--- a/development/translation/opie-lupdate/numberh.cpp
+++ b/development/translation/opie-lupdate/numberh.cpp
@@ -1,72 +1,78 @@
/**********************************************************************
** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
** This file is part of Qt Linguist.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <metatranslator.h>
#include <qmemarray.h>
#include <qcstring.h>
#include <qmap.h>
#include <qstringlist.h>
#include <ctype.h>
typedef QMap<QCString, MetaTranslatorMessage> TMM;
typedef QValueList<MetaTranslatorMessage> TML;
static bool isDigitFriendly( int c )
{
- return ispunct( c ) || isspace( c );
+ return ispunct((uchar)c) || isspace((uchar)c);
}
static int numberLength( const char *s )
{
int i = 0;
- if ( isdigit(s[0]) ) {
+ if ( isdigit((uchar)s[0]) ) {
do {
i++;
- } while ( isdigit(s[i]) ||
+ } while (isdigit((uchar)s[i]) ||
(isDigitFriendly(s[i]) &&
- (isdigit(s[i + 1]) ||
- (isDigitFriendly(s[i + 1]) && isdigit(s[i + 2])))) );
+ (isdigit((uchar)s[i + 1]) ||
+ (isDigitFriendly(s[i + 1]) && isdigit((uchar)s[i + 2])))));
}
return i;
}
/*
Returns a version of 'key' where all numbers have been replaced by zeroes. If
there were none, returns "".
*/
static QCString zeroKey( const char *key )
{
QCString zeroed( strlen(key) + 1 );
char *z = zeroed.data();
int i = 0, j = 0;
int len;
bool metSomething = FALSE;
while ( key[i] != '\0' ) {
len = numberLength( key + i );
if ( len > 0 ) {
i += len;
z[j++] = '0';
metSomething = TRUE;
} else {
z[j++] = key[i++];
@@ -190,46 +196,46 @@ static QString translationAttempt( const QString& oldTranslation,
}
}
return attempt;
}
/*
Augments a MetaTranslator with translations easily derived from
similar existing (probably obsolete) translations.
For example, if "TeX 3.0" is translated as "XeT 3.0" and "TeX 3.1"
has no translation, "XeT 3.1" is added to the translator and is
marked Unfinished.
*/
void applyNumberHeuristic( MetaTranslator *tor, bool verbose )
{
TMM translated, untranslated;
TMM::Iterator t, u;
TML all = tor->messages();
TML::Iterator it;
int inserted = 0;
for ( it = all.begin(); it != all.end(); ++it ) {
if ( (*it).type() == MetaTranslatorMessage::Unfinished ) {
if ( (*it).translation().isEmpty() )
- untranslated.insert( zeroKey((*it).sourceText()), *it );
+ untranslated.insert(QCString((*it).context()) + "\n" + (*it).sourceText() + "\n"
+ + (*it).comment(), *it);
} else if ( !(*it).translation().isEmpty() ) {
translated.insert( zeroKey((*it).sourceText()), *it );
}
}
for ( u = untranslated.begin(); u != untranslated.end(); ++u ) {
- t = translated.find( u.key() );
+ t = translated.find( zeroKey((*u).sourceText()) );
if ( t != translated.end() && !t.key().isEmpty() &&
qstrcmp((*t).sourceText(), (*u).sourceText()) != 0 ) {
MetaTranslatorMessage m( *u );
- m.setTranslation( translationAttempt((*t).translation(),
- (*t).sourceText(),
+ m.setTranslation(translationAttempt((*t).translation(), (*t).sourceText(),
(*u).sourceText()) );
tor->insert( m );
inserted++;
}
}
if ( verbose && inserted != 0 )
fprintf( stderr, " number heuristic provided %d translation%s\n",
inserted, inserted == 1 ? "" : "s" );
}
diff --git a/development/translation/opie-lupdate/sametexth.cpp b/development/translation/opie-lupdate/sametexth.cpp
index 574cfd5..80909b3 100644
--- a/development/translation/opie-lupdate/sametexth.cpp
+++ b/development/translation/opie-lupdate/sametexth.cpp
@@ -1,38 +1,44 @@
/**********************************************************************
** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
** This file is part of Qt Linguist.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <metatranslator.h>
#include <qcstring.h>
#include <qmap.h>
typedef QMap<QCString, MetaTranslatorMessage> TMM;
typedef QValueList<MetaTranslatorMessage> TML;
/*
Augments a MetaTranslator with trivially derived translations.
For example, if "Enabled:" is consistendly translated as "Eingeschaltet:" no
matter the context or the comment, "Eingeschaltet:" is added as the
translation of any untranslated "Enabled:" text and is marked Unfinished.
*/
void applySameTextHeuristic( MetaTranslator *tor, bool verbose )
{