mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 06:35:08 -04:00
added for plugins own dir
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1850 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
97d8640f3a
commit
87344de7d4
809 changed files with 790 additions and 722 deletions
30
plugins/smplayer_plugin/languages/main.cpp
Normal file
30
plugins/smplayer_plugin/languages/main.cpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
#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;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue