mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Language preference: store the locale name in the settings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
67a226c00a
commit
b972bdb97d
1 changed files with 7 additions and 0 deletions
|
@ -53,9 +53,16 @@ void PreferencesLanguage::syncSettings()
|
||||||
QMessageBox::warning(this, tr("Restart required"),
|
QMessageBox::warning(this, tr("Restart required"),
|
||||||
tr("To correctly load a new language you must restart Subsurface."));
|
tr("To correctly load a new language you must restart Subsurface."));
|
||||||
}
|
}
|
||||||
|
QAbstractItemModel *m = ui->languageDropdown->model();
|
||||||
|
QModelIndexList languages = m->match(m->index(0, 0), Qt::DisplayRole, currentText);
|
||||||
|
QString currentLocale;
|
||||||
|
if (languages.count())
|
||||||
|
currentLocale = m->data(languages.first(),Qt::UserRole).toString();
|
||||||
|
|
||||||
|
|
||||||
auto lang = SettingsObjectWrapper::instance()->language_settings;
|
auto lang = SettingsObjectWrapper::instance()->language_settings;
|
||||||
lang->setLanguage(currentText);
|
lang->setLanguage(currentText);
|
||||||
|
lang->setLangLocale(currentLocale);
|
||||||
lang->setUseSystemLanguage(ui->languageSystemDefault->isChecked());
|
lang->setUseSystemLanguage(ui->languageSystemDefault->isChecked());
|
||||||
lang->setTimeFormatOverride(!ui->timeFormatSystemDefault->isChecked());
|
lang->setTimeFormatOverride(!ui->timeFormatSystemDefault->isChecked());
|
||||||
lang->setDateFormatOverride(!ui->dateFormatSystemDefault->isChecked());
|
lang->setDateFormatOverride(!ui->dateFormatSystemDefault->isChecked());
|
||||||
|
|
Loading…
Reference in a new issue