From 74aece5552226c7b6ee8a6eab0d399f5b3330d64 Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Sat, 31 May 2014 13:09:53 +0200 Subject: [PATCH] I've added QTranslate, my app is now multi-language --- diary-mobile.pro | 4 +- diary-mobile_en_EN.ts | 247 ++++++++++++++--------------- diary-mobile_fr_FR.ts | 352 +++++++++++++++++++++--------------------- main.cpp | 3 +- mainwindow.cpp | 22 +-- mainwindow.h | 1 + 6 files changed, 319 insertions(+), 310 deletions(-) diff --git a/diary-mobile.pro b/diary-mobile.pro index e53a06b..c2de641 100644 --- a/diary-mobile.pro +++ b/diary-mobile.pro @@ -34,6 +34,8 @@ OTHER_FILES += \ ui.sql \ README.md \ android/AndroidManifest.xml \ - jean_victor_balin_book.png + jean_victor_balin_book.png \ + diary-mobile_en_EN.ts \ + diary-mobile_fr_FR.ts ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android diff --git a/diary-mobile_en_EN.ts b/diary-mobile_en_EN.ts index 1f0d0cb..5314bfd 100644 --- a/diary-mobile_en_EN.ts +++ b/diary-mobile_en_EN.ts @@ -4,18 +4,18 @@ MainWindow - - choice + + first button file - first button file + Enter the URL to download the first buttons file - - Enter the URL to download the first buttons + + choice @@ -43,290 +43,293 @@ Enter ID of button to edit - Entrez l'ID du bouton à éditez - + &File - + &Start - &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 - - - New entry + + &Quit - - label - Title of box where ask for new button's label + + Ctrl+Q + File|Quit - - Enter his label - his/her/?they? I've forget my school lesson + + A&dd buttons - - keyword - Title of box where ask for new button's keyword + + Ctrl+D + Buttons|Add - - Enter they keyword (no limit !) + + Sa&v buttons - - action - Title of box where ask for new button's action + + Ctrl+V + Buttons|Save - - Enter his action + + &Edit buttons - - askkeyword - Title of box where ask for keyword to getbuttons + + Ctrl+E + Buttons|&Edit - - Enter the keyword : + + &View/Hide menu - - keyword - Title of box where ask for button's keyword + + Ctrl+T + Buttons|View menu - - new keyword - question to get new button's keyword + + + New entry - - label - Title of box where ask for button's label + + getButtons - - new label - question to get new button's label + + About Qt - - action - Title of box where ask for button's action + + ctrl+H + Help|About Qt - - new action - question to get new button's action + + C&reate Database - - RAWsent - message title when data has been send + + Ctrl+R + Help|CreateDB - - sendRAW finish - message text when data has been send + + label + Title of box where ask for new button's label - - Upload finish : - pop-up when data has been sent + + Enter his label + his/her/?they? I've forget my school lesson - - uploadDB - pop-up title when data has been sent + + keyword + Title of box where ask for new button's keyword - - Uisent - pop-up title when buttons has been sent + + Enter they keyword (no limit !) - - savbuttons finish - pop-up text when buttons has been sent + + action + Title of box where ask for new button's action - - Enter the keyword : - ask keyword to get buttons + + Enter his action - - Ctrl+Q - File|Quit + + askkeyword + Title of box where ask for keyword to getbuttons - - &Quit + + chooseButtonDB - - A&dd buttons + + Enter the keyword : - - Ctrl+D - Buttons|Add + + keyword + Title of box where ask for button's keyword - - Sa&v buttons + + new keyword + question to get new button's keyword - - Ctrl+V - Buttons|Save + + label + Title of box where ask for button's label - - &Edit buttons + + new label + question to get new button's label - - Ctrl+E - Buttons|&Edit + + action + Title of box where ask for button's action - - &View/Hide menu + + new action + question to get new button's action - - Ctrl+T - Buttons|View menu + + RAWsent + message title when data has been send - - - getButtons + + sendRAW finish + message text when data has been send - - About Qt + + Upload finish : + pop-up when data has been sent - - ctrl+H - Help|About Qt + + uploadDB + pop-up title when data has been sent - - C&reate Database + + Uisent + pop-up title when buttons has been sent - - Ctrl+R - Help|CreateDB + + savbuttons finish + pop-up text when buttons has been sent - - chooseButtonDB + + Enter the keyword : + ask keyword to get buttons + + + + + getButtons + title to ask keyword fot getbuttons diff --git a/diary-mobile_fr_FR.ts b/diary-mobile_fr_FR.ts index 8b0c575..55638e6 100644 --- a/diary-mobile_fr_FR.ts +++ b/diary-mobile_fr_FR.ts @@ -3,339 +3,339 @@ 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 - + Premier fichier de bouton - Enter the URL to download the first buttons - + Enter the URL to download the first buttons file + Entrez l'URL pour télécharger vos boutons + + + + choice + Choix Please choose an action. - + choisissez une action get file title to ask file - + choisissez un fichier box box title to show a text - + info set - + définir Enter ID of button to edit - Entrez l'ID du bouton à éditez - + Entrez l'ID du bouton à éditer - + &File - + &Fichier - + &Start - &Start... - + &Départ + + + Ctrl+S + Fichier|Départ + Ctrl+D - + Ctrl+S File|Start - + Ctrl+D - + &Back - + &Retour - + Ctrl+B File|Back - + Ctrl+R - + &DownloadUi - + TéléchargementUi - + Ctrl+W File|Downlad - + Ctrl+D - + sendRAW - + envoyerRAW - + Ctrl+L File|Upload - + Ctrl+L - + Reset Ui - + Réinitialiser Ui - + Ctrl+Z File|ResetUi - + Ctrl+Z - + Reset RAW - + Réinitialiser RAW + + + + &Quit + &Quitter + + + + Ctrl+Q + File|Quit + Ctrl+Q + + + + A&dd buttons + A&joutez un boutons + + + + Ctrl+D + Buttons|Add + Ctrl+J + + + + Sa&v buttons + Sauvez les bouttons + + + + Ctrl+V + Buttons|Save + Ctrl+V - + &Edit buttons + &Editer les boutons + + + + Ctrl+E + Buttons|&Edit + Ctrl+E + + + + &View/Hide menu + Voir/Cacher le menu + + + + Ctrl+T + Buttons|View menu + Ctrl+C + + + + New entry - + Nouvelle entré - + + getButtons + getButtons + + + + About Qt + A propos de Qt + + + + ctrl+H + Help|About Qt + Ctrl+A + + + + C&reate Database + C&réer une base de donné + + + + Ctrl+R + Help|CreateDB + Ctrl+R + + + label Title of box where ask for new button's label - + Etiquette - + Enter his label his/her/?they? I've forget my school lesson - + Entrez son étiquette - + keyword Title of box where ask for new button's keyword - + mot-clé - + Enter they keyword (no limit !) - + Entrez les mots clé (no limit !) - + action Title of box where ask for new button's action - + action - + Enter his action - + Entrez son action - + askkeyword Title of box where ask for keyword to getbuttons - + mot-clé ? - + + chooseButtonDB + chooseButtonDB + + + Enter the keyword : - + Entrez le mot-clé : - + keyword Title of box where ask for button's keyword - + mot-clé - + new keyword question to get new button's keyword - + nouveau mot-clé - + label Title of box where ask for button's label - + étiquette - + new label question to get new button's label - + nouvel étiquette - + action Title of box where ask for button's action - + action - + new action question to get new button's action - + nouvelle action - + RAWsent message title when data has been send - + RAWsent - + sendRAW finish message text when data has been send - + données envoyées - + Upload finish : pop-up when data has been sent - + Upload finit : - + uploadDB pop-up title when data has been sent - + uploadDB - + Uisent pop-up title when buttons has been sent - + Envoyé - + savbuttons finish pop-up text when buttons has been sent - + boutons sauvegardés sur le serveur - + Enter the keyword : ask keyword to get buttons - - - - - Ctrl+Q - File|Quit - - - - - &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 - + Entrez le mot-clé : - - + getButtons - - - - - About Qt - - - - - ctrl+H - Help|About Qt - - - - - C&reate Database - - - - - Ctrl+R - Help|CreateDB - - - - - chooseButtonDB - + title to ask keyword fot getbuttons + getBoutons diff --git a/main.cpp b/main.cpp index 68af5ee..71d04de 100644 --- a/main.cpp +++ b/main.cpp @@ -31,8 +31,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) + qDebug()<<"local="<allKeys().size()==0){ qDebug()<<"first"; firstrun(); + download(QString("http://www.nothing2do.eu/diary-mobile_")+ QLocale::system().name()+ QString(".qm")); + connect(m, SIGNAL(downloaded()), SLOT(writeTr())); conf->setValue(QString("first"), 1); }; screen=new QWidget(this); screen->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); - /*scroll=new QScrollArea(screen); - scroll->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); - scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - scroll->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - scroll->setWidgetResizable(0);*/ grid=new QGridLayout(screen); - //scroll->show(); grid->setSizeConstraint(QLayout::SetMinAndMaxSize); - /*ks=new QsKineticScroller(scroll); - ks->enableKineticScrollFor(scroll);*/ signalmap=new QSignalMapper(this); connect(signalmap, SIGNAL(mapped(const QString &)), this, SLOT(action(const QString &))); connect(this, SIGNAL(datafilled()), this, SLOT(start())); @@ -69,7 +63,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) screen->show(); if((conf->value(QString("first")).toInt()==1)){ qDebug()<<"second"; - 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()); + QString ser=QInputDialog::getText(this, trUtf8("first button file"), trUtf8("Enter the URL to download the first buttons file"), QLineEdit::Normal, conf->value(QString("download")).toString()); if(ser!="")conf->setValue(QString("download"), ser); createDB(); downloadUi(); @@ -677,7 +671,7 @@ void MainWindow::resetRAW(){ exec(QList({"delete from raw;"})); } void MainWindow::getButtons(){ - const QString a=QInputDialog::getText(this, trUtf8("getButtons"), trUtf8("Enter the keyword : ", "ask keyword to get buttons")); + const QString a=QInputDialog::getText(this, trUtf8("getButtons", "title to ask keyword fot getbuttons"), trUtf8("Enter the keyword : ", "ask keyword to get buttons")); getButtons(a); } void MainWindow::insertButton(const QString & keyword, const QString & label, const QString & action){ @@ -720,3 +714,11 @@ void MainWindow::removeButton(const QString & keyword, const QString & label, co exec(QList({conf->value(QString("updatebuttons")).toString(), key, label, action, id})); } } +void MainWindow::writeTr(){ + QString a="diary-mobile_" + QLocale::system().name(); + qDebug()<<"a="<downloadedData()); + +} diff --git a/mainwindow.h b/mainwindow.h index 66eabc8..84536b2 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -154,6 +154,7 @@ private slots: void getButtons(); void downloadUi(); void writeUi(); + void writeTr(); void sendRAW(); void RAWsent(); void Uisent(); -- 2.45.1