From 6b181d6b8579b8281257a0d3cdeaff4769c96477 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 20 Sep 2016 12:47:31 -0700 Subject: [PATCH] Language preference: remove the .qm suffix before handling locale Otherwise things don't match as one might expect... Signed-off-by: Dirk Hohndel --- qt-models/models.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt-models/models.cpp b/qt-models/models.cpp index 655213e62..5b2f7f779 100644 --- a/qt-models/models.cpp +++ b/qt-models/models.cpp @@ -82,11 +82,11 @@ QVariant LanguageModel::data(const QModelIndex &index, int role) const return QVariant(); switch (role) { case Qt::DisplayRole: { - QLocale l(currentString.remove("subsurface_")); + QLocale l(currentString.remove("subsurface_").remove(".qm")); return currentString == "English" ? currentString : QString("%1 (%2)").arg(l.languageToString(l.language())).arg(l.countryToString(l.country())); } case Qt::UserRole: - return currentString == "English" ? "en_US" : currentString.remove("subsurface_"); + return currentString == "English" ? "en_US" : currentString.remove("subsurface_").remove(".qm"); } return QVariant(); }