You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
803 B
39 lines
803 B
#include <iostream>
|
|
using namespace std;
|
|
#include "GettextParser.h"
|
|
#include <fstream>
|
|
#include "GettextLexer.h"
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
if ( argc != 2 ) {
|
|
tqWarning( "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";
|
|
}
|
|
}
|
|
|
|
}
|
|
|