From 4623d7098bc7c5c7c6e90d916359e3a578fb91dd Mon Sep 17 00:00:00 2001 From: Sergey Starosek Date: Sat, 7 Dec 2013 21:50:15 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/models.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'qt-ui') 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); } } -- cgit v1.2.3-70-g09d2