mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-05-06 14:39:43 +00:00
fix load languags
This commit is contained in:
parent
3cf69bb5a3
commit
79d2a8ccb3
@ -21,11 +21,9 @@ using namespace QuasarAppUtils;
|
|||||||
bool QuasarAppUtils::Locales::findQm(const QString& localePrefix,
|
bool QuasarAppUtils::Locales::findQm(const QString& localePrefix,
|
||||||
QFileInfoList &qmFiles) {
|
QFileInfoList &qmFiles) {
|
||||||
|
|
||||||
if (localePrefix.isEmpty())
|
if (localePrefix.size() < 2)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
qDebug() << "Search for " << localePrefix;
|
|
||||||
|
|
||||||
const auto prefixes = localePrefix.split(QRegularExpression("[_-]"));
|
const auto prefixes = localePrefix.split(QRegularExpression("[_-]"));
|
||||||
|
|
||||||
auto prefixIt = prefixes.begin();
|
auto prefixIt = prefixes.begin();
|
||||||
@ -34,8 +32,6 @@ bool QuasarAppUtils::Locales::findQm(const QString& localePrefix,
|
|||||||
qmFiles += QDir(location).entryInfoList({"*" + (*prefixIt).toLower() + "*.qm"}, QDir::Files);
|
qmFiles += QDir(location).entryInfoList({"*" + (*prefixIt).toLower() + "*.qm"}, QDir::Files);
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "Found" << qmFiles;
|
|
||||||
|
|
||||||
return qmFiles.size();
|
return qmFiles.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user