Add QTranslator support for launcher

Add French translation for launcher

Clean launcher main.cpp (appTranslator.load)

Remove french translation

Remove string translation file

Update AUTHORS.md
pull/556/head
Brouilles 5 years ago committed by DEZEIRAUD Gaëtan
parent 2fa4aa9f3f
commit 3889c0fa7b

@ -74,6 +74,7 @@ Programmers
Fil Krynicki (filkry) Fil Krynicki (filkry)
Finbar Crago(finbar-crago) Finbar Crago(finbar-crago)
Florian Weber (Florianjw) Florian Weber (Florianjw)
Gaëtan Dezeiraud (Brouilles)
Gašper Sedej Gašper Sedej
Gijsbert ter Horst (Ghostbird) Gijsbert ter Horst (Ghostbird)
Gohan1989 Gohan1989

@ -1,6 +1,7 @@
#include <iostream> #include <iostream>
#include <QApplication> #include <QApplication>
#include <QTranslator>
#include <QTextCodec> #include <QTextCodec>
#include <QDir> #include <QDir>
#include <QDebug> #include <QDebug>
@ -26,6 +27,13 @@ int main(int argc, char *argv[])
QApplication app(argc, argv); QApplication app(argc, argv);
// Internationalization
QString locale = QLocale::system().name().section('_', 0, 0);
QTranslator appTranslator;
appTranslator.load(":/translations/" + locale + ".qm");
app.installTranslator(&appTranslator);
// Now we make sure the current dir is set to application path // Now we make sure the current dir is set to application path
QDir dir(QCoreApplication::applicationDirPath()); QDir dir(QCoreApplication::applicationDirPath());

@ -55,6 +55,7 @@ Launcher::MainDialog::MainDialog(QWidget *parent)
iconWidget->setFlow(QListView::LeftToRight); iconWidget->setFlow(QListView::LeftToRight);
QPushButton *playButton = new QPushButton(tr("Play")); QPushButton *playButton = new QPushButton(tr("Play"));
buttonBox->button(QDialogButtonBox::Close)->setText(tr("Close"));
buttonBox->addButton(playButton, QDialogButtonBox::AcceptRole); buttonBox->addButton(playButton, QDialogButtonBox::AcceptRole);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(close())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(close()));

@ -27,13 +27,13 @@ Launcher::SettingsPage::SettingsPage(Files::ConfigurationManager &cfg,
setupUi(this); setupUi(this);
QStringList languages; QStringList languages;
languages << QLatin1String("English") languages << tr("English")
<< QLatin1String("French") << tr("French")
<< QLatin1String("German") << tr("German")
<< QLatin1String("Italian") << tr("Italian")
<< QLatin1String("Polish") << tr("Polish")
<< QLatin1String("Russian") << tr("Russian")
<< QLatin1String("Spanish"); << tr("Spanish");
languageComboBox->addItems(languages); languageComboBox->addItems(languages);

Loading…
Cancel
Save