fix load languags
All checks were successful
buildbot/IOSCMakeBuilder Build finished.
buildbot/WindowsBuilder Build finished.
buildbot/WindowsCMakeBuilder Build finished.

This commit is contained in:
Andrei Yankovich 2022-07-06 01:17:30 +03:00
parent 3cf69bb5a3
commit 79d2a8ccb3

View File

@ -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();
} }