diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-03-30 10:40:34 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-03-31 16:37:13 (GMT) |
commit | ba40d481456095304729d0ef4279e0a53281798a (patch) | |
tree | 43b99eba0a10cb52c695eeea978505bbcdf8a516 /tools | |
parent | 2aad03302a80f609359ba6bb29aab9fdad08d608 (diff) | |
download | Qt-ba40d481456095304729d0ef4279e0a53281798a.zip Qt-ba40d481456095304729d0ef4279e0a53281798a.tar.gz Qt-ba40d481456095304729d0ef4279e0a53281798a.tar.bz2 |
support gettext POT files
these are in fact the same as PO files, only that exporting to one
automatically drops translations.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/linguist/shared/po.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/linguist/shared/po.cpp b/tools/linguist/shared/po.cpp index bdd8c25..87b2a8a 100644 --- a/tools/linguist/shared/po.cpp +++ b/tools/linguist/shared/po.cpp @@ -692,6 +692,13 @@ bool savePO(const Translator &translator, QIODevice &dev, ConversionData &cd) return ok; } +static bool savePOT(const Translator &translator, QIODevice &dev, ConversionData &cd) +{ + Translator ttor = translator; + ttor.dropTranslations(); + return savePO(ttor, dev, cd); +} + int initPO() { Translator::FileFormat format; @@ -702,6 +709,13 @@ int initPO() format.fileType = Translator::FileFormat::TranslationSource; format.priority = 1; Translator::registerFileFormat(format); + format.extension = QLatin1String("pot"); + format.description = QObject::tr("GNU Gettext localization template files"); + format.loader = &loadPO; + format.saver = &savePOT; + format.fileType = Translator::FileFormat::TranslationSource; + format.priority = -1; + Translator::registerFileFormat(format); return 1; } |