1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-29 12:20:41 +00:00

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
This commit is contained in:
Brouilles 2019-11-23 17:42:10 +01:00 committed by DEZEIRAUD Gaëtan
parent 2fa4aa9f3f
commit 3889c0fa7b
4 changed files with 17 additions and 7 deletions

View File

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

View File

@ -1,6 +1,7 @@
#include <iostream>
#include <QApplication>
#include <QTranslator>
#include <QTextCodec>
#include <QDir>
#include <QDebug>
@ -26,6 +27,13 @@ int main(int argc, char *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
QDir dir(QCoreApplication::applicationDirPath());

View File

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

View File

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