From b5e18d25875db35bac9044ce338e4317c3a4df34 Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Sat, 31 May 2014 11:00:59 +0200 Subject: [PATCH] added every things to translate soft easily --- diary-mobile.pro | 2 +- diary-mobile_en.ts => diary-mobile_en_EN.ts | 231 +++++++++++-------- diary-mobile_fr.ts => diary-mobile_fr_FR.ts | 235 ++++++++++++-------- main.cpp | 4 +- mainwindow.cpp | 46 ++-- 5 files changed, 309 insertions(+), 209 deletions(-) rename diary-mobile_en.ts => diary-mobile_en_EN.ts (66%) rename diary-mobile_fr.ts => diary-mobile_fr_FR.ts (65%) diff --git a/diary-mobile.pro b/diary-mobile.pro index f4d3cfb..e53a06b 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 +TRANSLATIONS = diary-mobile_fr_FR.ts diary-mobile_en_EN.ts ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android OTHER_FILES += \ diff --git a/diary-mobile_en.ts b/diary-mobile_en_EN.ts similarity index 66% rename from diary-mobile_en.ts rename to diary-mobile_en_EN.ts index a38ffb6..1f0d0cb 100644 --- a/diary-mobile_en.ts +++ b/diary-mobile_en_EN.ts @@ -4,33 +4,35 @@ MainWindow - - fichier initial + + choice - + - Entrez l'adresse du serveur où télécharger les premier boutons + first button file - - choice + + Enter the URL to download the first buttons - Veuillez choisir une action. + Please choose an action. get file + title to ask file box + box title to show a text @@ -38,9 +40,10 @@ set - + - Entrez l'ID du bouton à éditez + Enter ID of button to edit + Entrez l'ID du bouton à éditez @@ -50,7 +53,8 @@ - &Start... + &Start + &Start... @@ -93,193 +97,236 @@ - + Reset Ui - + Ctrl+Z File|ResetUi - + Reset RAW - - &Quit... + + + New entry - - Ctrl+Q - File|Quit + + label + Title of box where ask for new button's label - - A&dd buttons + + Enter his label + his/her/?they? I've forget my school lesson - - Ctrl+D - Buttons|Add + + keyword + Title of box where ask for new button's keyword - - Sa&v buttons + + Enter they keyword (no limit !) - - Ctrl+V - Buttons|Save + + action + Title of box where ask for new button's action - - &Edit buttons + + Enter his action - - Ctrl+E - Buttons|&Edit + + askkeyword + Title of box where ask for keyword to getbuttons - - &View/Hide menu + + Enter the keyword : - - Ctrl+T - Buttons|View menu + + keyword + Title of box where ask for button's keyword - - - Nouvelle entré + + + new keyword + question to get new button's keyword - - - getButtons + + label + Title of box where ask for button's label - - About Qt + + new label + question to get new button's label - - ctrl+H - Help|About Qt + + action + Title of box where ask for button's action - - C&reate Database + + new action + question to get new button's action - - Ctrl+R - Help|CreateDB + + RAWsent + message title when data has been send - - - nouvelle entrée + + + sendRAW finish + message text when data has been send - - Entrez son label + + Upload finish : + pop-up when data has been sent - - - Entrez ses mots clé (no limit !) + + + uploadDB + pop-up title when data has been sent + + + + + Uisent + pop-up title when buttons has been sent - - Entrez son action + + savbuttons finish + pop-up text when buttons has been sent - - chooseButtonDB + + Enter the keyword : + ask keyword to get buttons - - - - Entrez le mots-clé : + + + Ctrl+Q + File|Quit - - keyword + + &Quit - - new keyword + + A&dd buttons - - label + + Ctrl+D + Buttons|Add - - new label + + Sa&v buttons - - action + + Ctrl+V + Buttons|Save - - new action + + &Edit buttons - - RAWsent + + Ctrl+E + Buttons|&Edit - - sendRAW finish + + &View/Hide menu - - Upload finish : + + Ctrl+T + Buttons|View menu - - Uisent + + + getButtons - - savbuttons finish + + About Qt + + + + + ctrl+H + Help|About Qt + + + + + C&reate Database + + + + + Ctrl+R + Help|CreateDB + + + + + chooseButtonDB diff --git a/diary-mobile_fr.ts b/diary-mobile_fr_FR.ts similarity index 65% rename from diary-mobile_fr.ts rename to diary-mobile_fr_FR.ts index aa67095..8b0c575 100644 --- a/diary-mobile_fr.ts +++ b/diary-mobile_fr_FR.ts @@ -4,33 +4,43 @@ MainWindow - fichier initial - + fichier initial - Entrez l'adresse du serveur où télécharger les premier boutons - + Entrez l'adresse du serveur où télecharger les premier boutons choice + + + first button file + + + + + Enter the URL to download the first buttons + + - Veuillez choisir une action. + Please choose an action. get file + title to ask file box + box title to show a text @@ -38,9 +48,10 @@ set - + - Entrez l'ID du bouton à éditez + Enter ID of button to edit + Entrez l'ID du bouton à éditez @@ -50,7 +61,8 @@ - &Start... + &Start + &Start... @@ -93,193 +105,236 @@ - + Reset Ui - + Ctrl+Z File|ResetUi - + Reset RAW - - &Quit... + + + New entry - - Ctrl+Q - File|Quit + + label + Title of box where ask for new button's label - - A&dd buttons + + Enter his label + his/her/?they? I've forget my school lesson - - Ctrl+D - Buttons|Add + + keyword + Title of box where ask for new button's keyword - - Sa&v buttons + + Enter they keyword (no limit !) - - Ctrl+V - Buttons|Save + + action + Title of box where ask for new button's action - - &Edit buttons + + Enter his action - - Ctrl+E - Buttons|&Edit + + askkeyword + Title of box where ask for keyword to getbuttons - - &View/Hide menu + + Enter the keyword : - - Ctrl+T - Buttons|View menu + + keyword + Title of box where ask for button's keyword - - - Nouvelle entré + + + new keyword + question to get new button's keyword - - - getButtons + + label + Title of box where ask for button's label - - About Qt + + new label + question to get new button's label - - ctrl+H - Help|About Qt + + action + Title of box where ask for button's action - - C&reate Database + + new action + question to get new button's action - - Ctrl+R - Help|CreateDB + + RAWsent + message title when data has been send - - - nouvelle entrée + + + sendRAW finish + message text when data has been send - - Entrez son label + + Upload finish : + pop-up when data has been sent - - - Entrez ses mots clé (no limit !) + + + uploadDB + pop-up title when data has been sent - - Entrez son action + + Uisent + pop-up title when buttons has been sent - - chooseButtonDB + + savbuttons finish + pop-up text when buttons has been sent - - - - Entrez le mots-clé : + + + Enter the keyword : + ask keyword to get buttons - - keyword + + Ctrl+Q + File|Quit - - new keyword + + &Quit - - label + + A&dd buttons - - new label + + Ctrl+D + Buttons|Add - - action + + Sa&v buttons - - new action + + Ctrl+V + Buttons|Save - - RAWsent + + &Edit buttons - - sendRAW finish + + Ctrl+E + Buttons|&Edit - - Upload finish : + + &View/Hide menu - - Uisent + + Ctrl+T + Buttons|View menu - - savbuttons finish + + + getButtons + + + + + About Qt + + + + + ctrl+H + Help|About Qt + + + + + C&reate Database + + + + + Ctrl+R + Help|CreateDB + + + + + chooseButtonDB diff --git a/main.cpp b/main.cpp index cebe7c7..68af5ee 100644 --- a/main.cpp +++ b/main.cpp @@ -30,9 +30,9 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); - QString locale = QLocale::system().name().section('_', 0, 0); + QString locale = QLocale::system().name();//.section('_', 0, 0) QTranslator translator; - translator.load(QString("qt_") + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + translator.load(QString("diary-mobile_") + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); a.installTranslator(&translator); MainWindow w; w.show(); diff --git a/mainwindow.cpp b/mainwindow.cpp index b715456..c4c5602 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, trUtf8("fichier initial"), trUtf8("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("first button file"), trUtf8("Enter the URL to download the first buttons"), QLineEdit::Normal, conf->value(QString("download")).toString()); if(ser!="")conf->setValue(QString("download"), ser); createDB(); downloadUi(); @@ -196,7 +196,7 @@ void MainWindow::action(const QString &a){ } else if(b[0]==QString("a/b")){ bool ok; - QString e=QInputDialog::getItem(this, trUtf8("choice"), trUtf8("Veuillez choisir une action."), c.split(conf->value(QString("sepchc")).toString()), 0, 0, &ok); + QString e=QInputDialog::getItem(this, trUtf8("choice"), trUtf8("Please choose an 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, trUtf8("get file"), conf->value(b[1]).toString()); + QString e=QFileDialog::getSaveFileName(this, trUtf8("get file", "title to ask file"), conf->value(b[1]).toString()); if(ok)conf->setValue(b[1], e); } else if(b[0]==QString("box")){ - QMessageBox::information(this, trUtf8("box"), c); + QMessageBox::information(this, trUtf8("box", "box title to show a text"), c); } else if(b[0]==QString("quit")){ @@ -237,7 +237,7 @@ void MainWindow::action(const QString &a){ QString e; bool ok; if(b.size()<=1){ - e=QInputDialog::getText(this, QString("ID"), trUtf8("Entrez l'ID du bouton à éditez"), QLineEdit::Normal, QString(""), &ok); + e=QInputDialog::getText(this, QString("ID"), trUtf8("Enter ID of button to edit"), QLineEdit::Normal, QString(""), &ok); if(ok)editButtonDB(e); } else editButtonDB(b[1]); @@ -251,26 +251,24 @@ void MainWindow::action(const QString &a){ } void MainWindow::createMenuBar(){ FileMenu=new QMenu(trUtf8("&File"), this); - FileMenu->addAction(trUtf8("&Start..."), this, SLOT(start()),QKeySequence(trUtf8("Ctrl+S", "File|Start"))); + 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"))); FileMenu->addAction(trUtf8("sendRAW"), this, SLOT(sendRAW()),QKeySequence(trUtf8("Ctrl+L", "File|Upload"))); - //FileMenu->addAction(trUtf8("Rest&ore"), this, SLOT(restoreDB()),QKeySequence(trUtf8("Ctrl+O", "File|Restore"))); FileMenu->addAction(trUtf8("Reset Ui"), this, SLOT(resetUi()), QKeySequence(trUtf8("Ctrl+Z", "File|ResetUi"))); FileMenu->addAction(trUtf8("Reset RAW"), this, SLOT(resetRAW())); - FileMenu->addAction(trUtf8("&Quit..."), this, SLOT(quit()),QKeySequence(trUtf8("Ctrl+Q", "File|Quit"))); + FileMenu->addAction(trUtf8("&Quit"), this, SLOT(quit()),QKeySequence(trUtf8("Ctrl+Q", "File|Quit"))); menuBar()->addMenu(FileMenu); EditMenu=new QMenu(QString("&Buttons")); EditMenu->addAction(trUtf8("A&dd buttons"), this, SLOT(addButtonDB()), QKeySequence(trUtf8("Ctrl+D", "Buttons|Add"))); EditMenu->addAction(trUtf8("Sa&v buttons"), this, SLOT(savButtons()), QKeySequence(trUtf8("Ctrl+V", "Buttons|Save"))); EditMenu->addAction(trUtf8("&Edit buttons"), this, SLOT(chooseButtonDB()), QKeySequence(trUtf8("Ctrl+E", "Buttons|&Edit"))); - //EditMenu->addAction(trUtf8("&Edit buttons by ID"), this, SLOT(editButtonById()), QKeySequence(trUtf8("Ctrl+I", "Buttons|Edit by &id"))); EditMenu->addAction(trUtf8("&View/Hide menu"), this, SLOT(toggleMenu()), QKeySequence(trUtf8("Ctrl+T", "Buttons|View menu"))); menuBar()->addMenu(EditMenu); HelpMenu=new QMenu(QString("&Help")); - HelpMenu->addAction(trUtf8("Nouvelle entré"), this, SLOT(entry())); - HelpMenu->addAction(trUtf8("getButtons"), this, SLOT(getButtons()), QKeySequence("")); + HelpMenu->addAction(trUtf8("New entry"), this, SLOT(entry())); + HelpMenu->addAction(trUtf8("getButtons"), this, SLOT(getButtons())); HelpMenu->addAction(trUtf8("About Qt"), qApp, SLOT(aboutQt()), QKeySequence(tr("ctrl+H", "Help|About Qt"))); EditMenu->addAction(trUtf8("C&reate Database"), this, SLOT(createDB()), QKeySequence(trUtf8("Ctrl+R", "Help|CreateDB"))); menuBar()->addMenu(HelpMenu); @@ -410,7 +408,7 @@ void MainWindow::entry(const QString &a){ context.append(way.last()); if(a=="")label=context+" : "; else label=context+", "+a+" : "; - entry=QInputDialog::getText(this, trUtf8("nouvelle entrée"), label, QLineEdit::Normal, "", &ok); + entry=QInputDialog::getText(this, trUtf8("New entry"), label, QLineEdit::Normal, "", &ok); if(ok==0)return; QString c; if(a=="")c=context+" : "+entry; @@ -432,11 +430,11 @@ void MainWindow::addButtonDB(){ qDebug()<<"addButtonDB()"; bool ok=0; QString cur=label->text(); - QString a, b, c=QInputDialog::getText(this, QString("label"), trUtf8("Entrez son label"),QLineEdit::Normal, QString(""), &ok); + QString a, b, c=QInputDialog::getText(this, trUtf8("label", "Title of box where ask for new button's label"), trUtf8("Enter his label", "his/her/?they? I've forget my school lesson"),QLineEdit::Normal, QString(""), &ok); if ((c=="")||(ok==0))return; - b=QInputDialog::getText(this, QString("keyword"), trUtf8("Entrez ses mots clé (no limit !)"), QLineEdit::Normal, cur, &ok); + b=QInputDialog::getText(this, trUtf8("keyword", "Title of box where ask for new button's keyword"), trUtf8("Enter they keyword (no limit !)"), QLineEdit::Normal, cur, &ok); if ((b=="")||(ok==0))return; - a=QInputDialog::getText(this, QString("action"), trUtf8("Entrez son action"), QLineEdit::Normal, c, &ok); + a=QInputDialog::getText(this, trUtf8("action", "Title of box where ask for new button's action"), trUtf8("Enter his action"), QLineEdit::Normal, c, &ok); if ((a=="")||(ok==0))return; insertButton(b, c, a); return; @@ -470,7 +468,7 @@ void MainWindow::getButtons(const QString &b){ } void MainWindow::chooseButtonDB(){ QString a; - if(conf->value(QString("askkeyword")).toBool())a=QInputDialog::getText(this, trUtf8("chooseButtonDB"), trUtf8("Entrez le mots-clé : "), QLineEdit::Normal, label->text()); + if(conf->value(trUtf8("askkeyword", "Title of box where ask for keyword to getbuttons")).toBool())a=QInputDialog::getText(this, trUtf8("chooseButtonDB"), trUtf8("Enter the keyword : "), QLineEdit::Normal, label->text()); else a=label->text(); chooseButtonDB(a); } @@ -491,11 +489,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, trUtf8("keyword"), trUtf8("new keyword"), QLineEdit::Normal, keyword, &ok); + const QString tmpkeyword=QInputDialog::getText(this, trUtf8("keyword", "Title of box where ask for button's keyword"), trUtf8("new keyword", "question to get new button's keyword"), QLineEdit::Normal, keyword, &ok); if(!ok)return; - const QString tmplabel=QInputDialog::getText(this, trUtf8("label"), trUtf8("new label"), QLineEdit::Normal, label, &ok); + const QString tmplabel=QInputDialog::getText(this, trUtf8("label", "Title of box where ask for button's label"), trUtf8("new label", "question to get new button's label"), QLineEdit::Normal, label, &ok); if(!ok)return; - const QString tmpaction=QInputDialog::getText(this, trUtf8("action"), trUtf8("new action"), QLineEdit::Normal, action, &ok); + const QString tmpaction=QInputDialog::getText(this, trUtf8("action", "Title of box where ask for button's action"), trUtf8("new action", "question to get new button's action"), QLineEdit::Normal, action, &ok); if(!ok)return; if((tmpkeyword=="")||(tmplabel=="")||(tmpaction=="")){ //exec(QList({conf->value(QString("deletebuttons")).toString(), a})); @@ -539,7 +537,7 @@ void MainWindow::sendRAW(){ } void MainWindow::RAWsent(){ qDebug()<<"RAWsent"; - QMessageBox::information(this, trUtf8("RAWsent"), trUtf8("sendRAW finish")); + QMessageBox::information(this, trUtf8("RAWsent", "message title when data has been send"), trUtf8("sendRAW finish", "message text when data has been send")); } void MainWindow::back(){ flush(); @@ -622,11 +620,11 @@ void MainWindow::readButtons(const QByteArray &in){ } void MainWindow::datasent(){ qDebug()<<"datasent"; - QString texte=trUtf8("Upload finish : "); + QString texte=trUtf8("Upload finish : ", "pop-up when data has been sent"); texte=texte+conf->value(QString("uploadDB")).toString(); qDebug()<<"texte : "<({"delete from ui;"})); @@ -673,13 +671,13 @@ void MainWindow::savButtons(){ } void MainWindow::Uisent(){ qDebug()<<"Uisent"; - QMessageBox::information(this, trUtf8("Uisent"), trUtf8("savbuttons finish")); + QMessageBox::information(this, trUtf8("Uisent", "pop-up title when buttons has been sent"), trUtf8("savbuttons finish", "pop-up text when buttons has been sent")); } void MainWindow::resetRAW(){ exec(QList({"delete from raw;"})); } void MainWindow::getButtons(){ - const QString a=QInputDialog::getText(this, trUtf8("getButtons"), trUtf8("Entrez le mots-clé : ")); + const QString a=QInputDialog::getText(this, trUtf8("getButtons"), trUtf8("Enter the keyword : ", "ask keyword to get buttons")); getButtons(a); } void MainWindow::insertButton(const QString & keyword, const QString & label, const QString & action){ -- 2.45.1