Language preference: search for the locale instead of the language string

And make sure that you use the language / country delimiter that we use in the
file system

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-09-20 12:42:59 -07:00
parent 6b181d6b85
commit 67a226c00a

View file

@ -37,7 +37,7 @@ void PreferencesLanguage::refreshSettings()
ui->dateFormatEntry->setText(prefs.date_format);
ui->shortDateFormatEntry->setText(prefs.date_format_short);
QAbstractItemModel *m = ui->languageDropdown->model();
QModelIndexList languages = m->match(m->index(0, 0), Qt::UserRole, prefs.locale.language);
QModelIndexList languages = m->match(m->index(0, 0), Qt::UserRole, QString(prefs.locale.lang_locale).replace("-", "_"));
if (languages.count())
ui->languageDropdown->setCurrentIndex(languages.first().row());
}