RetroShare/plugins/smplayer_plugin/languages/main.cpp
defnax 87344de7d4 added for plugins own dir
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1850 b45a01b8-16f6-495d-af2f-9b41ad6348cc
2009-11-28 14:21:11 +00:00

31 lines
715 B
C++

#include <QFile>
#include <QRegExp>
#include <stdio.h>
int main( int argc, char ** argv )
{
QFile file("list.txt");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return -1;
QRegExp rx("^([a-zA-Z]+) ([a-zA-Z\\-]+)");
QString line;
while (!file.atEnd()) {
line = QString(file.readLine()).simplified();
if (!line.isEmpty()) {
//qDebug("%s", line.toLatin1().constData());
if (rx.indexIn(line) > -1) {
QString s1 = rx.cap(1);
QString s2 = rx.cap(2);
//qDebug("code: %s, language: %s", s1.toLatin1().constData(), s2.toLatin1().constData());
printf("\tl[\"%s\"] = tr(\"%s\");\n", s1.toLatin1().constData(), s2.toLatin1().constData());
}
}
}
file.close();
return 0;
}