Diffstat (limited to 'development/translation/opie-lupdate/numberh.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | development/translation/opie-lupdate/numberh.cpp | 28 |
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 @@ | |||
10 | ** | 10 | ** |
11 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition | ||
12 | ** licenses may use this file in accordance with the Qt Commercial License | ||
13 | ** Agreement provided with the Software. | ||
14 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
@@ -14,2 +18,4 @@ | |||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 18 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
19 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for | ||
20 | ** information about Qt Commercial License Agreements. | ||
15 | ** | 21 | ** |
@@ -34,3 +40,3 @@ static bool isDigitFriendly( int c ) | |||
34 | { | 40 | { |
35 | return ispunct( c ) || isspace( c ); | 41 | return ispunct((uchar)c) || isspace((uchar)c); |
36 | } | 42 | } |
@@ -41,9 +47,9 @@ static int numberLength( const char *s ) | |||
41 | 47 | ||
42 | if ( isdigit(s[0]) ) { | 48 | if ( isdigit((uchar)s[0]) ) { |
43 | do { | 49 | do { |
44 | i++; | 50 | i++; |
45 | } while ( isdigit(s[i]) || | 51 | } while (isdigit((uchar)s[i]) || |
46 | (isDigitFriendly(s[i]) && | 52 | (isDigitFriendly(s[i]) && |
47 | (isdigit(s[i + 1]) || | 53 | (isdigit((uchar)s[i + 1]) || |
48 | (isDigitFriendly(s[i + 1]) && isdigit(s[i + 2])))) ); | 54 | (isDigitFriendly(s[i + 1]) && isdigit((uchar)s[i + 2]))))); |
49 | } | 55 | } |
@@ -213,3 +219,4 @@ void applyNumberHeuristic( MetaTranslator *tor, bool verbose ) | |||
213 | if ( (*it).translation().isEmpty() ) | 219 | if ( (*it).translation().isEmpty() ) |
214 | untranslated.insert( zeroKey((*it).sourceText()), *it ); | 220 | untranslated.insert(QCString((*it).context()) + "\n" + (*it).sourceText() + "\n" |
221 | + (*it).comment(), *it); | ||
215 | } else if ( !(*it).translation().isEmpty() ) { | 222 | } else if ( !(*it).translation().isEmpty() ) { |
@@ -220,3 +227,3 @@ void applyNumberHeuristic( MetaTranslator *tor, bool verbose ) | |||
220 | for ( u = untranslated.begin(); u != untranslated.end(); ++u ) { | 227 | for ( u = untranslated.begin(); u != untranslated.end(); ++u ) { |
221 | t = translated.find( u.key() ); | 228 | t = translated.find( zeroKey((*u).sourceText()) ); |
222 | if ( t != translated.end() && !t.key().isEmpty() && | 229 | if ( t != translated.end() && !t.key().isEmpty() && |
@@ -224,5 +231,4 @@ void applyNumberHeuristic( MetaTranslator *tor, bool verbose ) | |||
224 | MetaTranslatorMessage m( *u ); | 231 | MetaTranslatorMessage m( *u ); |
225 | m.setTranslation( translationAttempt((*t).translation(), | 232 | m.setTranslation(translationAttempt((*t).translation(), (*t).sourceText(), |
226 | (*t).sourceText(), | 233 | (*u).sourceText())); |
227 | (*u).sourceText()) ); | ||
228 | tor->insert( m ); | 234 | tor->insert( m ); |