Changeset 561 for trunk/tools/linguist/shared/xliff.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/tools/linguist/shared/xliff.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the Qt Linguist of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 244 244 } 245 245 246 static void writeTransUnits(QTextStream &ts, const TranslatorMessage &msg, const QRegExp &drops, int indent, 247 const Translator &translator, ConversionData &cd, bool *ok) 246 static void writeTransUnits(QTextStream &ts, const TranslatorMessage &msg, const QRegExp &drops, int indent) 248 247 { 249 248 static int msgid; 250 249 QString msgidstr = !msg.id().isEmpty() ? msg.id() : QString::fromAscii("_msg%1").arg(++msgid); 251 250 252 QStringList translns = translator.normalizedTranslations(msg, cd, ok);251 QStringList translns = ); 253 252 QHash<QString, QString>::const_iterator it; 254 253 QString pluralStr; … … 304 303 if (transit != transend) { 305 304 translation = *transit; 305 306 306 307 ++transit; 307 308 puttrans = true; … … 348 349 } 349 350 350 static void writeMessage(QTextStream &ts, const TranslatorMessage &msg, const QRegExp &drops, int indent, 351 const Translator &translator, ConversionData &cd, bool *ok) 351 static void writeMessage(QTextStream &ts, const TranslatorMessage &msg, const QRegExp &drops, int indent) 352 352 { 353 353 if (msg.isPlural()) { … … 363 363 writeComment(ts, msg, drops, indent); 364 364 365 writeTransUnits(ts, msg, drops, indent , translator, cd, ok);365 writeTransUnits(ts, msg, drops, indent); 366 366 --indent; 367 367 writeIndent(ts, indent); 368 368 ts << "</group>\n"; 369 369 } else { 370 writeTransUnits(ts, msg, drops, indent , translator, cd, ok);370 writeTransUnits(ts, msg, drops, indent); 371 371 } 372 372 } … … 501 501 m_fileName = atts.value(QLatin1String("original")); 502 502 m_language = atts.value(QLatin1String("target-language")); 503 503 504 m_sourceLanguage = atts.value(QLatin1String("source-language")); 505 504 506 } else if (localName == QLatin1String("group")) { 505 507 if (atts.value(QLatin1String("restype")) == QLatin1String(restypeContext)) { … … 599 601 } 600 602 } else if (localName == QLatin1String("target")) { 601 if (popContext(XC_restype_translation)) 603 if (popContext(XC_restype_translation)) { 604 accum.replace(QChar(Translator::TextVariantSeparator), 605 QChar(Translator::BinaryVariantSeparator)); 602 606 m_translations.append(accum); 607 603 608 } else if (localName == QLatin1String("context-group")) { 604 609 if (popContext(XC_context_group)) { … … 771 776 ++indent; 772 777 writeExtras(ts, indent, translator.extras(), drops); 778 779 780 781 782 783 784 773 785 foreach (const QString &fn, fileOrder) { 774 786 writeIndent(ts, indent); 775 787 ts << "<file original=\"" << fn << "\"" 776 788 << " datatype=\"" << dataType(messageOrder[fn].begin()->first()) << "\"" 777 << " source-language=\"" 778 << (translator.sourceLanguageCode().isEmpty() ? 779 QByteArray("en") : translator.sourceLanguageCode().toLatin1()) << "\"" 780 << " target-language=\"" << translator.languageCode() << "\"" 789 << " source-language=\"" << sourceLanguageCode.toLatin1() << "\"" 790 << " target-language=\"" << languageCode.toLatin1() << "\"" 781 791 << "><body>\n"; 782 792 ++indent; … … 791 801 792 802 foreach (const TranslatorMessage &msg, messageOrder[fn][ctx]) 793 writeMessage(ts, msg, drops, indent , translator, cd, &ok);803 writeMessage(ts, msg, drops, indent); 794 804 795 805 if (!ctx.isEmpty()) {
Note:
See TracChangeset
for help on using the changeset viewer.