summaryrefslogtreecommitdiff
path: root/development/translation/opie-lupdate/numberh.cpp
Side-by-side diff
Diffstat (limited to 'development/translation/opie-lupdate/numberh.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--development/translation/opie-lupdate/numberh.cpp28
1 files changed, 17 insertions, 11 deletions
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
@@ -10,2 +10,6 @@
**
+** 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
@@ -14,2 +18,4 @@
** 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.
**
@@ -34,3 +40,3 @@ static bool isDigitFriendly( int c )
{
- return ispunct( c ) || isspace( c );
+ return ispunct((uchar)c) || isspace((uchar)c);
}
@@ -41,9 +47,9 @@ static int numberLength( const char *s )
- if ( isdigit(s[0]) ) {
+ if ( isdigit((uchar)s[0]) ) {
do {
i++;
- } while ( isdigit(s[i]) ||
- (isDigitFriendly(s[i]) &&
- (isdigit(s[i + 1]) ||
- (isDigitFriendly(s[i + 1]) && isdigit(s[i + 2])))) );
+ } while (isdigit((uchar)s[i]) ||
+ (isDigitFriendly(s[i]) &&
+ (isdigit((uchar)s[i + 1]) ||
+ (isDigitFriendly(s[i + 1]) && isdigit((uchar)s[i + 2])))));
}
@@ -213,3 +219,4 @@ void applyNumberHeuristic( MetaTranslator *tor, bool verbose )
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() ) {
@@ -220,3 +227,3 @@ void applyNumberHeuristic( MetaTranslator *tor, bool verbose )
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() &&
@@ -224,5 +231,4 @@ void applyNumberHeuristic( MetaTranslator *tor, bool verbose )
MetaTranslatorMessage m( *u );
- m.setTranslation( translationAttempt((*t).translation(),
- (*t).sourceText(),
- (*u).sourceText()) );
+ m.setTranslation(translationAttempt((*t).translation(), (*t).sourceText(),
+ (*u).sourceText()));
tor->insert( m );