mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 07:53:25 +00:00
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>
This commit is contained in:
parent
b144e64b9b
commit
4623d7098b
1 changed files with 2 additions and 3 deletions
|
@ -1756,11 +1756,10 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QVariant LanguageModel::data(const QModelIndex& index, int role) const
|
||||
|
|
Loading…
Add table
Reference in a new issue