tools/linguist/lupdate/merge.cpp
changeset 37 758a864f9613
parent 18 2f34d5167611
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
    42 #include "lupdate.h"
    42 #include "lupdate.h"
    43 
    43 
    44 #include "simtexth.h"
    44 #include "simtexth.h"
    45 #include "translator.h"
    45 #include "translator.h"
    46 
    46 
       
    47 #include <QtCore/QCoreApplication>
    47 #include <QtCore/QDebug>
    48 #include <QtCore/QDebug>
    48 #include <QtCore/QMap>
    49 #include <QtCore/QMap>
    49 #include <QtCore/QStringList>
    50 #include <QtCore/QStringList>
    50 #include <QtCore/QTextCodec>
    51 #include <QtCore/QTextCodec>
    51 #include <QtCore/QVector>
    52 #include <QtCore/QVector>
    52 
    53 
    53 
       
    54 QT_BEGIN_NAMESPACE
    54 QT_BEGIN_NAMESPACE
       
    55 
       
    56 class LU {
       
    57     Q_DECLARE_TR_FUNCTIONS(LUpdate)
       
    58 };
    55 
    59 
    56 static bool isDigitFriendly(QChar c)
    60 static bool isDigitFriendly(QChar c)
    57 {
    61 {
    58     return c.isPunct() || c.isSpace();
    62     return c.isPunct() || c.isSpace();
    59 }
    63 }
   483     */
   487     */
   484     int sameNumberHeuristicCount = (options & HeuristicNumber) ? applyNumberHeuristic(outTor) : 0;
   488     int sameNumberHeuristicCount = (options & HeuristicNumber) ? applyNumberHeuristic(outTor) : 0;
   485 
   489 
   486     if (options & Verbose) {
   490     if (options & Verbose) {
   487         int totalFound = neww + known;
   491         int totalFound = neww + known;
   488         err += QObject::tr("    Found %n source text(s) (%1 new and %2 already existing)\n", 0, totalFound).arg(neww).arg(known);
   492         err += LU::tr("    Found %n source text(s) (%1 new and %2 already existing)\n", 0, totalFound).arg(neww).arg(known);
   489 
   493 
   490         if (obsoleted) {
   494         if (obsoleted) {
   491             if (options & NoObsolete) {
   495             if (options & NoObsolete) {
   492                 err += QObject::tr("    Removed %n obsolete entries\n", 0, obsoleted);
   496                 err += LU::tr("    Removed %n obsolete entries\n", 0, obsoleted);
   493             } else {
   497             } else {
   494                 err += QObject::tr("    Kept %n obsolete entries\n", 0, obsoleted);
   498                 err += LU::tr("    Kept %n obsolete entries\n", 0, obsoleted);
   495             }
   499             }
   496         }
   500         }
   497 
   501 
   498         if (sameNumberHeuristicCount)
   502         if (sameNumberHeuristicCount)
   499             err += QObject::tr("    Number heuristic provided %n translation(s)\n",
   503             err += LU::tr("    Number heuristic provided %n translation(s)\n",
   500                       0, sameNumberHeuristicCount);
   504                       0, sameNumberHeuristicCount);
   501         if (sameTextHeuristicCount)
   505         if (sameTextHeuristicCount)
   502             err += QObject::tr("    Same-text heuristic provided %n translation(s)\n",
   506             err += LU::tr("    Same-text heuristic provided %n translation(s)\n",
   503                       0, sameTextHeuristicCount);
   507                       0, sameTextHeuristicCount);
   504         if (similarTextHeuristicCount)
   508         if (similarTextHeuristicCount)
   505             err += QObject::tr("    Similar-text heuristic provided %n translation(s)\n",
   509             err += LU::tr("    Similar-text heuristic provided %n translation(s)\n",
   506                       0, similarTextHeuristicCount);
   510                       0, similarTextHeuristicCount);
   507     }
   511     }
   508     return outTor;
   512     return outTor;
   509 }
   513 }
   510 
   514