From: Norbert Moutarde Date: Sat, 31 May 2014 07:29:14 +0000 (+0200) Subject: added translation possibility (remember that buttons isn't compiled, at all,) X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=65c4a4653c52ec7c89a45848ddd7dd977e5c8683;p=diary-mobile.git added translation possibility (remember that buttons isn't compiled, at all,) --- diff --git a/diary-mobile.pro b/diary-mobile.pro index c683f3e..f4d3cfb 100644 --- a/diary-mobile.pro +++ b/diary-mobile.pro @@ -26,7 +26,7 @@ HEADERS += mainwindow.h \ CONFIG += mobility c++11 MOBILITY = QMAKE_CXXFLAGS += -fpermissive - +TRANSLATIONS = diary-mobile_fr.ts diary-mobile_en.ts ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android OTHER_FILES += \ diff --git a/diary-mobile_en.ts b/diary-mobile_en.ts new file mode 100644 index 0000000..a38ffb6 --- /dev/null +++ b/diary-mobile_en.ts @@ -0,0 +1,286 @@ + + + + + MainWindow + + + fichier initial + + + + + Entrez l'adresse du serveur où télécharger les premier boutons + + + + + choice + + + + + Veuillez choisir une action. + + + + + get file + + + + + box + + + + + set + + + + + Entrez l'ID du bouton à éditez + + + + + &File + + + + + &Start... + + + + + Ctrl+S + File|Start + + + + + &Back + + + + + Ctrl+B + File|Back + + + + + &DownloadUi + + + + + Ctrl+W + File|Downlad + + + + + sendRAW + + + + + Ctrl+L + File|Upload + + + + + Reset Ui + + + + + Ctrl+Z + File|ResetUi + + + + + Reset RAW + + + + + &Quit... + + + + + Ctrl+Q + File|Quit + + + + + A&dd buttons + + + + + Ctrl+D + Buttons|Add + + + + + Sa&v buttons + + + + + Ctrl+V + Buttons|Save + + + + + &Edit buttons + + + + + Ctrl+E + Buttons|&Edit + + + + + &View/Hide menu + + + + + Ctrl+T + Buttons|View menu + + + + + Nouvelle entré + + + + + + getButtons + + + + + About Qt + + + + + ctrl+H + Help|About Qt + + + + + C&reate Database + + + + + Ctrl+R + Help|CreateDB + + + + + nouvelle entrée + + + + + Entrez son label + + + + + Entrez ses mots clé (no limit !) + + + + + Entrez son action + + + + + chooseButtonDB + + + + + + Entrez le mots-clé : + + + + + keyword + + + + + new keyword + + + + + label + + + + + new label + + + + + action + + + + + new action + + + + + RAWsent + + + + + sendRAW finish + + + + + Upload finish : + + + + + Uisent + + + + + savbuttons finish + + + + diff --git a/diary-mobile_fr.ts b/diary-mobile_fr.ts new file mode 100644 index 0000000..aa67095 --- /dev/null +++ b/diary-mobile_fr.ts @@ -0,0 +1,286 @@ + + + + + MainWindow + + + fichier initial + + + + + Entrez l'adresse du serveur où télécharger les premier boutons + + + + + choice + + + + + Veuillez choisir une action. + + + + + get file + + + + + box + + + + + set + + + + + Entrez l'ID du bouton à éditez + + + + + &File + + + + + &Start... + + + + + Ctrl+S + File|Start + + + + + &Back + + + + + Ctrl+B + File|Back + + + + + &DownloadUi + + + + + Ctrl+W + File|Downlad + + + + + sendRAW + + + + + Ctrl+L + File|Upload + + + + + Reset Ui + + + + + Ctrl+Z + File|ResetUi + + + + + Reset RAW + + + + + &Quit... + + + + + Ctrl+Q + File|Quit + + + + + A&dd buttons + + + + + Ctrl+D + Buttons|Add + + + + + Sa&v buttons + + + + + Ctrl+V + Buttons|Save + + + + + &Edit buttons + + + + + Ctrl+E + Buttons|&Edit + + + + + &View/Hide menu + + + + + Ctrl+T + Buttons|View menu + + + + + Nouvelle entré + + + + + + getButtons + + + + + About Qt + + + + + ctrl+H + Help|About Qt + + + + + C&reate Database + + + + + Ctrl+R + Help|CreateDB + + + + + nouvelle entrée + + + + + Entrez son label + + + + + Entrez ses mots clé (no limit !) + + + + + Entrez son action + + + + + chooseButtonDB + + + + + + Entrez le mots-clé : + + + + + keyword + + + + + new keyword + + + + + label + + + + + new label + + + + + action + + + + + new action + + + + + RAWsent + + + + + sendRAW finish + + + + + Upload finish : + + + + + Uisent + + + + + savbuttons finish + + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index 80c78a5..b715456 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -69,7 +69,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) screen->show(); if((conf->value(QString("first")).toInt()==1)){ qDebug()<<"second"; - QString ser=QInputDialog::getText(this, "fichier initial", "Entrez l'adresse du serveur où télécharger les premier boutons", QLineEdit::Normal, conf->value(QString("download")).toString()); + QString ser=QInputDialog::getText(this, trUtf8("fichier initial"), trUtf8("Entrez l'adresse du serveur où télécharger les premier boutons"), QLineEdit::Normal, conf->value(QString("download")).toString()); if(ser!="")conf->setValue(QString("download"), ser); createDB(); downloadUi(); @@ -189,14 +189,14 @@ void MainWindow::action(const QString &a){ if(ok)conf->setValue(b[1], e); } else if(b[0]==QString("start")){ - getButtons(conf->value(QString("start")).toString()); + start(); } else if(b[0]==QString("new")){ entry(c); } else if(b[0]==QString("a/b")){ bool ok; - QString e=QInputDialog::getItem(this, QString("choice"), QString("Veuillez choisir une action."), c.split(conf->value(QString("sepchc")).toString()), 0, 0, &ok); + QString e=QInputDialog::getItem(this, trUtf8("choice"), trUtf8("Veuillez choisir une action."), c.split(conf->value(QString("sepchc")).toString()), 0, 0, &ok); if(ok)action(e); } else if(b[0]==QString("back")){ @@ -207,11 +207,11 @@ void MainWindow::action(const QString &a){ } else if(b[0]==QString("setfile")){ bool ok; - QString e=QFileDialog::getSaveFileName(this, QString("get file"), conf->value(b[1]).toString()); + QString e=QFileDialog::getSaveFileName(this, trUtf8("get file"), conf->value(b[1]).toString()); if(ok)conf->setValue(b[1], e); } else if(b[0]==QString("box")){ - QMessageBox::information(this, QString("box"), c); + QMessageBox::information(this, trUtf8("box"), c); } else if(b[0]==QString("quit")){ @@ -224,9 +224,9 @@ void MainWindow::action(const QString &a){ int value=c.count(conf->value(QString("sqlval")).toString()); QList cmd({c}); if (value){ - for(int d=0; d<=value; d++){ + for(int d=1; d<=value; d++){ bool ok; - QString e=QInputDialog::getText(this, "set", c+" : "+d, QLineEdit::Normal, QString(""), &ok); + QString e=QInputDialog::getText(this, trUtf8("set"), c+" : "+d, QLineEdit::Normal, QString(""), &ok); if(ok)cmd.append(e); else break;// in case of break, exec complain about cmd size } @@ -237,7 +237,7 @@ void MainWindow::action(const QString &a){ QString e; bool ok; if(b.size()<=1){ - e=QInputDialog::getText(this, QString("ID"), QString("Entrez l'ID du bouton à éditez"), QLineEdit::Normal, QString(""), &ok); + e=QInputDialog::getText(this, QString("ID"), trUtf8("Entrez l'ID du bouton à éditez"), QLineEdit::Normal, QString(""), &ok); if(ok)editButtonDB(e); } else editButtonDB(b[1]); @@ -250,7 +250,7 @@ void MainWindow::action(const QString &a){ else getButtons(a); } void MainWindow::createMenuBar(){ - FileMenu=new QMenu(QString("&File"), this); + FileMenu=new QMenu(trUtf8("&File"), this); FileMenu->addAction(trUtf8("&Start..."), this, SLOT(start()),QKeySequence(trUtf8("Ctrl+S", "File|Start"))); FileMenu->addAction(trUtf8("&Back"), this, SLOT(back()),QKeySequence(trUtf8("Ctrl+B", "File|Back"))); FileMenu->addAction(trUtf8("&DownloadUi"), this, SLOT(downloadUi()),QKeySequence(trUtf8("Ctrl+W", "File|Downlad"))); @@ -410,7 +410,7 @@ void MainWindow::entry(const QString &a){ context.append(way.last()); if(a=="")label=context+" : "; else label=context+", "+a+" : "; - entry=QInputDialog::getText(this, QString("nouvelle entrée"), label, QLineEdit::Normal, "", &ok); + entry=QInputDialog::getText(this, trUtf8("nouvelle entrée"), label, QLineEdit::Normal, "", &ok); if(ok==0)return; QString c; if(a=="")c=context+" : "+entry; @@ -432,11 +432,11 @@ void MainWindow::addButtonDB(){ qDebug()<<"addButtonDB()"; bool ok=0; QString cur=label->text(); - QString a, b, c=QInputDialog::getText(this, QString("label"), QString("Entrez son label"),QLineEdit::Normal, QString(""), &ok); + QString a, b, c=QInputDialog::getText(this, QString("label"), trUtf8("Entrez son label"),QLineEdit::Normal, QString(""), &ok); if ((c=="")||(ok==0))return; - b=QInputDialog::getText(this, QString("keyword"), QString("Entrez ses mots clé (no limit !)"), QLineEdit::Normal, cur, &ok); + b=QInputDialog::getText(this, QString("keyword"), trUtf8("Entrez ses mots clé (no limit !)"), QLineEdit::Normal, cur, &ok); if ((b=="")||(ok==0))return; - a=QInputDialog::getText(this, QString("action"), QString("Entrez son action"), QLineEdit::Normal, c, &ok); + a=QInputDialog::getText(this, QString("action"), trUtf8("Entrez son action"), QLineEdit::Normal, c, &ok); if ((a=="")||(ok==0))return; insertButton(b, c, a); return; @@ -470,7 +470,7 @@ void MainWindow::getButtons(const QString &b){ } void MainWindow::chooseButtonDB(){ QString a; - if(conf->value(QString("askkeyword")).toBool())a=QInputDialog::getText(this, QString("chooseButtonDB"), QString("Entrez le mots-clé : "), QLineEdit::Normal, label->text()); + if(conf->value(QString("askkeyword")).toBool())a=QInputDialog::getText(this, trUtf8("chooseButtonDB"), trUtf8("Entrez le mots-clé : "), QLineEdit::Normal, label->text()); else a=label->text(); chooseButtonDB(a); } @@ -491,11 +491,11 @@ void MainWindow::editButtonDB(const QString & a){ QString keyword=q->value(1).toString(); QString label=q->value(2).toString(); QString action=q->value(3).toString(); - const QString tmpkeyword=QInputDialog::getText(this, "keyword", "new keyword", QLineEdit::Normal, keyword, &ok); + const QString tmpkeyword=QInputDialog::getText(this, trUtf8("keyword"), trUtf8("new keyword"), QLineEdit::Normal, keyword, &ok); if(!ok)return; - const QString tmplabel=QInputDialog::getText(this, "label", "new label", QLineEdit::Normal, label, &ok); + const QString tmplabel=QInputDialog::getText(this, trUtf8("label"), trUtf8("new label"), QLineEdit::Normal, label, &ok); if(!ok)return; - const QString tmpaction=QInputDialog::getText(this, "action", "new action", QLineEdit::Normal, action, &ok); + const QString tmpaction=QInputDialog::getText(this, trUtf8("action"), trUtf8("new action"), QLineEdit::Normal, action, &ok); if(!ok)return; if((tmpkeyword=="")||(tmplabel=="")||(tmpaction=="")){ //exec(QList({conf->value(QString("deletebuttons")).toString(), a})); @@ -539,7 +539,7 @@ void MainWindow::sendRAW(){ } void MainWindow::RAWsent(){ qDebug()<<"RAWsent"; - QMessageBox::information(this, "RAWsent", "sendRAW finish"); + QMessageBox::information(this, trUtf8("RAWsent"), trUtf8("sendRAW finish")); } void MainWindow::back(){ flush(); @@ -622,7 +622,7 @@ void MainWindow::readButtons(const QByteArray &in){ } void MainWindow::datasent(){ qDebug()<<"datasent"; - QString texte="Upload finish : "; + QString texte=trUtf8("Upload finish : "); texte=texte+conf->value(QString("uploadDB")).toString(); qDebug()<<"texte : "<({"delete from raw;"})); } void MainWindow::getButtons(){ - const QString a=QInputDialog::getText(this, QString("getButtons"), QString("Entrez le mots-clé : ")); + const QString a=QInputDialog::getText(this, trUtf8("getButtons"), trUtf8("Entrez le mots-clé : ")); getButtons(a); } void MainWindow::insertButton(const QString & keyword, const QString & label, const QString & action){