aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Sergey Starosek <sergey.starosek@gmail.com>2013-12-07 21:50:15 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-07 12:06:33 -0800
commit4623d7098bc7c5c7c6e90d916359e3a578fb91dd (patch)
tree1c5fc4ab3d9a7ee142740c27e84c749dbb9c8753
parentb144e64b9b44c7c8eeaf4cfbaa9cdc805514c405 (diff)
downloadsubsurface-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.cpp5
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);
}
}