diff options
Diffstat (limited to 'tools/linguist/lupdate')
-rw-r--r-- | tools/linguist/lupdate/cpp.cpp | 41 | ||||
-rw-r--r-- | tools/linguist/lupdate/java.cpp | 4 | ||||
-rw-r--r-- | tools/linguist/lupdate/lupdate.1 | 41 | ||||
-rw-r--r-- | tools/linguist/lupdate/lupdate.h | 4 | ||||
-rw-r--r-- | tools/linguist/lupdate/main.cpp | 4 | ||||
-rw-r--r-- | tools/linguist/lupdate/merge.cpp | 4 | ||||
-rw-r--r-- | tools/linguist/lupdate/qscript.cpp | 4 | ||||
-rw-r--r-- | tools/linguist/lupdate/qscript.g | 4 | ||||
-rw-r--r-- | tools/linguist/lupdate/ui.cpp | 4 |
9 files changed, 78 insertions, 32 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp index 7f52c53..b1d2d01 100644 --- a/tools/linguist/lupdate/cpp.cpp +++ b/tools/linguist/lupdate/cpp.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Linguist of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -180,7 +180,8 @@ private: QString transcode(const QString &str, bool utf8); void recordMessage( int line, const QString &context, const QString &text, const QString &comment, - const QString &extracomment, bool utf8, bool plural); + const QString &extracomment, const QString &msgid, const TranslatorMessage::ExtraData &extra, + bool utf8, bool plural); void processInclude(const QString &file, ConversionData &cd, QSet<QString> &inclusions); @@ -1299,13 +1300,16 @@ QString CppParser::transcode(const QString &str, bool utf8) void CppParser::recordMessage( int line, const QString &context, const QString &text, const QString &comment, - const QString &extracomment, bool utf8, bool plural) + const QString &extracomment, const QString &msgid, const TranslatorMessage::ExtraData &extra, + bool utf8, bool plural) { TranslatorMessage msg( transcode(context, utf8), transcode(text, utf8), transcode(comment, utf8), QString(), yyFileName, line, QStringList(), TranslatorMessage::Unfinished, plural); msg.setExtraComment(transcode(extracomment.simplified(), utf8)); + msg.setId(msgid); + msg.setExtras(extra); if ((utf8 || yyForceUtf8) && !yyCodecIsUtf8 && msg.needs8Bit()) msg.setUtf8(true); results->tor->append(msg); @@ -1332,6 +1336,8 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) QString text; QString comment; QString extracomment; + QString msgid; + TranslatorMessage::ExtraData extra; QString prefix; #ifdef DIAGNOSE_RETRANSLATABILITY QString functionName; @@ -1604,9 +1610,11 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) prefix.clear(); } - recordMessage(line, context, text, comment, extracomment, utf8, plural); + recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural); } extracomment.clear(); + msgid.clear(); + extra.clear(); break; case Tok_translateUtf8: case Tok_translate: @@ -1655,9 +1663,11 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) break; } } - recordMessage(line, context, text, comment, extracomment, utf8, plural); + recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural); } extracomment.clear(); + msgid.clear(); + extra.clear(); break; case Tok_Q_DECLARE_TR_FUNCTIONS: case Tok_Q_OBJECT: @@ -1679,6 +1689,15 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) if (yyComment.startsWith(QLatin1Char(':'))) { yyComment.remove(0, 1); extracomment.append(yyComment); + } else if (yyComment.startsWith(QLatin1Char('='))) { + yyComment.remove(0, 1); + msgid = yyComment.simplified(); + } else if (yyComment.startsWith(QLatin1Char('~'))) { + yyComment.remove(0, 1); + yyComment = yyComment.trimmed(); + int k = yyComment.indexOf(QLatin1Char(' ')); + if (k > -1) + extra.insert(yyComment.left(k), yyComment.mid(k + 1).trimmed()); } else { comment = yyComment.simplified(); if (comment.startsWith(QLatin1String(MagicComment))) { @@ -1689,7 +1708,11 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) } else { context = comment.left(k); comment.remove(0, k + 1); - recordMessage(yyLineNo, context, QString(), comment, extracomment, false, false); + recordMessage(yyLineNo, context, QString(), comment, extracomment, + QString(), TranslatorMessage::ExtraData(), false, false); + extracomment.clear(); + results->tor->setExtras(extra); + extra.clear(); } } } @@ -1739,6 +1762,8 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) prospectiveContext.clear(); prefix.clear(); extracomment.clear(); + msgid.clear(); + extra.clear(); yyTokColonSeen = false; yyTok = getToken(); break; @@ -1799,7 +1824,7 @@ void loadCPP(Translator &translator, const QStringList &filenames, ConversionDat ? translator.codecName() : cd.m_codecForSource; QTextCodec *codec = QTextCodec::codecForName(codecName); - foreach (const QString filename, filenames) { + foreach (const QString &filename, filenames) { if (CppFiles::getResults(filename) || CppFiles::isBlacklisted(filename)) continue; diff --git a/tools/linguist/lupdate/java.cpp b/tools/linguist/lupdate/java.cpp index 658aebf..8a5d975 100644 --- a/tools/linguist/lupdate/java.cpp +++ b/tools/linguist/lupdate/java.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Linguist of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tools/linguist/lupdate/lupdate.1 b/tools/linguist/lupdate/lupdate.1 index e953273..68958b9 100644 --- a/tools/linguist/lupdate/lupdate.1 +++ b/tools/linguist/lupdate/lupdate.1 @@ -1,20 +1,41 @@ .TH lupdate 1 "18 October 2001" "Nokia Corporation and/or its subsidiary(-ies)" \" -*- nroff -*- .\" .\" Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -.\" Contact: Qt Software Information (qt-info@nokia.com) +.\" Contact: Nokia Corporation (qt-info@nokia.com) .\" -.\" 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. +.\" This file is part of the QtGui module of the Qt Toolkit. +.\" +.\" $QT_BEGIN_LICENSE:LGPL$ +.\" No Commercial Usage +.\" This file contains pre-release code and may not be distributed. +.\" You may use this file in accordance with the terms and conditions +.\" contained in the either Technology Preview License Agreement or the +.\" Beta Release License Agreement. .\" -.\" This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -.\" WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" GNU Lesser General Public License Usage +.\" Alternatively, this file may be used under the terms of the GNU Lesser +.\" General Public License version 2.1 as published by the Free Software +.\" Foundation and appearing in the file LICENSE.LGPL included in the +.\" packaging of this file. Please review the following information to +.\" ensure the GNU Lesser General Public License version 2.1 requirements +.\" will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. .\" -.\" See http://qtsoftware.com/gpl/ for GPL licensing information. +.\" In addition, as a special exception, Nokia gives you certain +.\" additional rights. These rights are described in the Nokia Qt LGPL +.\" Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +.\" package. +.\" +.\" GNU General Public License Usage +.\" Alternatively, this file may be used under the terms of the GNU +.\" General Public License version 3.0 as published by the Free Software +.\" Foundation and appearing in the file LICENSE.GPL included in the +.\" packaging of this file. Please review the following information to +.\" ensure the GNU General Public License version 3.0 requirements will be +.\" met: http://www.gnu.org/copyleft/gpl.html. .\" -.\" Contact qt-info@nokia.com if any conditions of this licensing are -.\" not clear to you. +.\" If you are unsure which license is appropriate for your use, please +.\" contact the sales department at http://www.qtsoftware.com/contact. +.\" $QT_END_LICENSE$ .\" .SH NAME lupdate \- update Qt Linguist translation files diff --git a/tools/linguist/lupdate/lupdate.h b/tools/linguist/lupdate/lupdate.h index 2f98643..7e28cf5 100644 --- a/tools/linguist/lupdate/lupdate.h +++ b/tools/linguist/lupdate/lupdate.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Linguist of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index 8a70b55..18c8932 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Linguist of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tools/linguist/lupdate/merge.cpp b/tools/linguist/lupdate/merge.cpp index 4849d6e..7925fb2 100644 --- a/tools/linguist/lupdate/merge.cpp +++ b/tools/linguist/lupdate/merge.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Linguist of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tools/linguist/lupdate/qscript.cpp b/tools/linguist/lupdate/qscript.cpp index 64adde6..7a701ae 100644 --- a/tools/linguist/lupdate/qscript.cpp +++ b/tools/linguist/lupdate/qscript.cpp @@ -2,7 +2,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Linguist of the Qt Toolkit. ** @@ -35,7 +35,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tools/linguist/lupdate/qscript.g b/tools/linguist/lupdate/qscript.g index 563974a..4e36395 100644 --- a/tools/linguist/lupdate/qscript.g +++ b/tools/linguist/lupdate/qscript.g @@ -1,7 +1,7 @@ ---------------------------------------------------------------------------- -- -- Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). --- Contact: Qt Software Information (qt-info@nokia.com) +-- Contact: Nokia Corporation (qt-info@nokia.com) -- -- This file is part of the Qt Linguist of the Qt Toolkit. -- @@ -34,7 +34,7 @@ -- met: http://www.gnu.org/copyleft/gpl.html. -- -- If you are unsure which license is appropriate for your use, please --- contact the sales department at qt-sales@nokia.com. +-- contact the sales department at http://www.qtsoftware.com/contact. -- $QT_END_LICENSE$ -- -- This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE diff --git a/tools/linguist/lupdate/ui.cpp b/tools/linguist/lupdate/ui.cpp index 935cac4..fb78b2a 100644 --- a/tools/linguist/lupdate/ui.cpp +++ b/tools/linguist/lupdate/ui.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Linguist of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ |