diff options
author | Sergey Starosek <sergey.starosek@gmail.com> | 2013-12-07 21:50:15 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-07 12:06:33 -0800 |
commit | 4623d7098bc7c5c7c6e90d916359e3a578fb91dd (patch) | |
tree | 1c5fc4ab3d9a7ee142740c27e84c749dbb9c8753 | |
parent | b144e64b9b44c7c8eeaf4cfbaa9cdc805514c405 (diff) | |
download | subsurface-4623d7098bc7c5c7c6e90d916359e3a578fb91dd.tar.gz |
Build language list from Subsurface translations
On Windows platform translation/ folder contains Qt translation
files as well. This results in extra languages in preferences.
From now we filter these translations and choose only those matching
^subsurface_*.qm$
Fixes #339
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/models.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index c83fcb903..fffc79700 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -1756,10 +1756,9 @@ LanguageModel::LanguageModel(QObject* parent): QAbstractListModel(parent) QDir d(getSubsurfaceDataPath("translations")); QStringList result = d.entryList(); Q_FOREACH(const QString& s, result){ - if ( !s.endsWith(".qm") ){ - continue; + if ( s.startsWith("subsurface_") && s.endsWith(".qm") ){ + languages.push_back( (s == "subsurface_source.qm") ? "English" : s); } - languages.push_back( (s == "subsurface_source.qm") ? "English" : s); } } |