Changeset 6b181d6 in subsurface for qt-models


Ignore:
Timestamp:
Sep 20, 2016, 12:48:30 PM (14 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
67a226c
Parents:
5fdbc1f
git-author:
Dirk Hohndel <dirk@…> (09/20/16 12:47:31)
git-committer:
Dirk Hohndel <dirk@…> (09/20/16 12:48:30)
Message:

Language preference: remove the .qm suffix before handling locale

Otherwise things don't match as one might expect...

Signed-off-by: Dirk Hohndel <dirk@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qt-models/models.cpp

    rb264c3e r6b181d6  
    8383        switch (role) {
    8484        case Qt::DisplayRole: {
    85                 QLocale l(currentString.remove("subsurface_"));
     85                QLocale l(currentString.remove("subsurface_").remove(".qm"));
    8686                return currentString == "English" ? currentString : QString("%1 (%2)").arg(l.languageToString(l.language())).arg(l.countryToString(l.country()));
    8787        }
    8888        case Qt::UserRole:
    89                 return currentString == "English" ? "en_US" : currentString.remove("subsurface_");
     89                return currentString == "English" ? "en_US" : currentString.remove("subsurface_").remove(".qm");
    9090        }
    9191        return QVariant();
Note: See TracChangeset for help on using the changeset viewer.