mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-30 01:46:11 -05:00
87344de7d4
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1850 b45a01b8-16f6-495d-af2f-9b41ad6348cc
31 lines
715 B
C++
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;
|
|
}
|
|
|