summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/SettingsDialog.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-01-12 23:04:05 +0100
committerPetr Mrázek <peterix@gmail.com>2014-01-12 23:04:05 +0100
commit54a9ee5eb03b6d1be6294e47179b9eb76f7a3949 (patch)
tree6454c95549fe42183d8b285a89517a734a6da5dc /gui/dialogs/SettingsDialog.cpp
parentf552366e03cd6bd693850e24503bf3bf3559cfd0 (diff)
parent8950953d915ba234f62da93b520a1b82594cb9dc (diff)
downloadMultiMC-54a9ee5eb03b6d1be6294e47179b9eb76f7a3949.tar
MultiMC-54a9ee5eb03b6d1be6294e47179b9eb76f7a3949.tar.gz
MultiMC-54a9ee5eb03b6d1be6294e47179b9eb76f7a3949.tar.lz
MultiMC-54a9ee5eb03b6d1be6294e47179b9eb76f7a3949.tar.xz
MultiMC-54a9ee5eb03b6d1be6294e47179b9eb76f7a3949.zip
Merge branch 'feature_localization' of https://github.com/02JanDal/MultiMC5 into develop
Conflicts: gui/dialogs/SettingsDialog.cpp gui/dialogs/SettingsDialog.ui
Diffstat (limited to 'gui/dialogs/SettingsDialog.cpp')
-rw-r--r--gui/dialogs/SettingsDialog.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp
index 00b3b1fd..b90434b0 100644
--- a/gui/dialogs/SettingsDialog.cpp
+++ b/gui/dialogs/SettingsDialog.cpp
@@ -284,6 +284,9 @@ void SettingsDialog::refreshUpdateChannelDesc()
void SettingsDialog::applySettings(SettingsObject *s)
{
+ // Language
+ s->set("Language", ui->languageBox->itemData(ui->languageBox->currentIndex()).toLocale().bcp47Name());
+
// Updates
s->set("AutoUpdate", ui->autoUpdateCheckBox->isChecked());
s->set("UpdateChannel", m_currentUpdateChannel);
@@ -365,6 +368,19 @@ void SettingsDialog::applySettings(SettingsObject *s)
void SettingsDialog::loadSettings(SettingsObject *s)
{
+ // Language
+ ui->languageBox->clear();
+ ui->languageBox->addItem(tr("English"), QLocale(QLocale::English));
+ foreach(const QString & lang,
+ QDir(MMC->root() + "/translations").entryList(QStringList() << "*.qm", QDir::Files))
+ {
+ QLocale locale(lang.section(QRegExp("[_\.]"), 1));
+ ui->languageBox->addItem(
+ QLocale::languageToString(locale.language()),
+ locale);
+ }
+ ui->languageBox->setCurrentIndex(ui->languageBox->findData(QLocale(s->get("Language").toString())));
+
// Updates
ui->autoUpdateCheckBox->setChecked(s->get("AutoUpdate").toBool());
m_currentUpdateChannel = s->get("UpdateChannel").toString();