Merge branch 'feature_localization' of https://github.com/02JanDal/MultiMC5 into develop
Conflicts: gui/dialogs/SettingsDialog.cpp gui/dialogs/SettingsDialog.ui
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user