From bd9e6617827818fd043452c08c606f07b78014a0 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- poxml/swappo.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 poxml/swappo.cpp (limited to 'poxml/swappo.cpp') diff --git a/poxml/swappo.cpp b/poxml/swappo.cpp new file mode 100644 index 00000000..94c308ae --- /dev/null +++ b/poxml/swappo.cpp @@ -0,0 +1,38 @@ +#include +using namespace std; +#include "GettextParser.hpp" +#include +#include "GettextLexer.hpp" + +int main(int argc, char **argv) +{ + if ( argc != 2 ) { + qWarning( "usage: %s pofile", argv[0] ); + return -1; + } + + MsgList translated; + + try { + ifstream s(argv[1]); + GettextLexer lexer(s); + GettextParser parser(lexer); + translated = parser.file(); + + } catch(exception& e) { + cerr << "exception: " << e.what() << endl; + return 1; + } + + for (MsgList::ConstIterator it = translated.begin(); + it != translated.end(); ++it) + { + if ( !( *it ).msgstr.isEmpty() ) { + outputMsg("msgid", (*it).msgstr); + outputMsg("msgstr", (*it).msgid); + cout << "\n"; + } + } + +} + -- cgit v1.2.1