mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
Language preference: remove the .qm suffix before handling locale
Otherwise things don't match as one might expect... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5fdbc1ffc3
commit
6b181d6b85
1 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue