diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-07-24 09:45:33 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-07-27 13:04:30 (GMT) |
commit | 3643028959f0b38350e57e60ba4000435b75e592 (patch) | |
tree | c129e4dee11487abd437ab8ebd993ba261e06fa6 /tools/linguist/lconvert/main.cpp | |
parent | cf66c667a97c0079141eb3f2d9e997b7378ae792 (diff) | |
parent | c36139c665e61866aff4bf8572890a735167a7d0 (diff) | |
download | Qt-3643028959f0b38350e57e60ba4000435b75e592.zip Qt-3643028959f0b38350e57e60ba4000435b75e592.tar.gz Qt-3643028959f0b38350e57e60ba4000435b75e592.tar.bz2 |
Merge commit 'qt/master-stable'
Conflicts:
configure.exe
qmake/Makefile.unix
qmake/generators/makefile.cpp
src/corelib/global/qglobal.h
src/corelib/kernel/kernel.pri
src/corelib/kernel/qcoreevent.cpp
src/corelib/kernel/qsharedmemory_unix.cpp
src/gui/graphicsview/qgraphicsscene.cpp
src/gui/kernel/qaction.cpp
src/gui/kernel/qaction.h
src/gui/kernel/qaction_p.h
src/gui/kernel/qapplication.cpp
src/gui/kernel/qapplication.h
src/gui/kernel/qwidget.cpp
src/gui/kernel/qwidget.h
src/gui/kernel/qwidget_mac.mm
src/gui/painting/qgraphicssystemfactory.cpp
src/gui/styles/qwindowsstyle.cpp
src/gui/text/qfontengine_qpf.cpp
src/gui/widgets/qabstractscrollarea_p.h
src/network/access/qnetworkaccessdebugpipebackend.cpp
src/network/socket/qlocalsocket_unix.cpp
src/network/socket/qnativesocketengine_p.h
src/network/socket/qnativesocketengine_unix.cpp
src/openvg/qpaintengine_vg.cpp
tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
tests/auto/qcssparser/qcssparser.pro
tests/auto/qdir/tst_qdir.cpp
tests/auto/qfile/tst_qfile.cpp
tests/auto/qobject/tst_qobject.cpp
tests/auto/qpathclipper/qpathclipper.pro
tests/auto/qprocess/tst_qprocess.cpp
tests/auto/qsettings/tst_qsettings.cpp
tests/auto/qsharedpointer/qsharedpointer.pro
tests/auto/qsqlquerymodel/qsqlquerymodel.pro
tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro
tests/auto/qsqltablemodel/qsqltablemodel.pro
tests/auto/qsqlthread/qsqlthread.pro
tests/auto/qwidget/tst_qwidget.cpp
Diffstat (limited to 'tools/linguist/lconvert/main.cpp')
-rw-r--r-- | tools/linguist/lconvert/main.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp index 534bc11..1381595 100644 --- a/tools/linguist/lconvert/main.cpp +++ b/tools/linguist/lconvert/main.cpp @@ -81,10 +81,13 @@ static int usage(const QStringList &args) " --output-format <outformat>\n" " Specify output format. See -if.\n\n" " --input-codec <codec>\n" - " Specify encoding for .qm input files. Default is 'Latin1'.\n" - " UTF-8 is always tried as well, corresponding to the trUtf8() function.\n\n" + " Specify encoding for QM and PO input files. Default is 'Latin1'\n" + " for QM and 'UTF-8' for PO files. UTF-8 is always tried as well for\n" + " QM, corresponding to the possible use of the trUtf8() function.\n\n" + " --output-codec <codec>\n" + " Specify encoding for PO output files. Default is 'UTF-8'.\n\n" " --drop-tags <regexp>\n" - " Drop named extra tags when writing 'ts' or 'xlf' files.\n" + " Drop named extra tags when writing TS or XLIFF files.\n" " May be specified repeatedly.\n\n" " --drop-translations\n" " Drop existing translations and reset the status to 'unfinished'.\n" @@ -101,10 +104,10 @@ static int usage(const QStringList &args) " --no-finished\n" " Drop finished messages.\n\n" " --locations {absolute|relative|none}\n" - " Override how source code references are saved in ts files.\n" + " Override how source code references are saved in TS files.\n" " Default is absolute.\n\n" " --no-ui-lines\n" - " Drop line numbers from references to .ui files.\n\n" + " Drop line numbers from references to UI files.\n\n" " --verbose\n" " be a bit more verbose\n\n" "Long options can be specified with only one leading dash, too.\n\n" @@ -141,7 +144,6 @@ int main(int argc, char *argv[]) Translator::LocationsType locations = Translator::DefaultLocations; ConversionData cd; - cd.m_codecForSource = "Latin1"; Translator tr; for (int i = 1; i < args.size(); ++i) { @@ -174,6 +176,10 @@ int main(int argc, char *argv[]) if (++i >= args.size()) return usage(args); cd.m_codecForSource = args[i].toLatin1(); + } else if (args[i] == QLatin1String("-output-codec")) { + if (++i >= args.size()) + return usage(args); + cd.m_outputCodec = args[i].toLatin1(); } else if (args[i] == QLatin1String("-drop-tag")) { if (++i >= args.size()) return usage(args); @@ -257,6 +263,11 @@ int main(int argc, char *argv[]) if (locations != Translator::DefaultLocations) tr.setLocationsType(locations); + tr.normalizeTranslations(cd); + if (!cd.errors().isEmpty()) { + qWarning("%s", qPrintable(cd.error())); + cd.clearErrors(); + } if (!tr.save(outFileName, cd, outFormat)) { qWarning("%s", qPrintable(cd.error())); return 3; |