mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-04-26 17:54:40 +00:00
fix load translations on android and ios dvices
This commit is contained in:
parent
11947d4cde
commit
071a01a2d6
13
locales.cpp
13
locales.cpp
@ -21,10 +21,21 @@ using namespace QuasarAppUtils;
|
||||
bool QuasarAppUtils::Locales::findQm(const QString& localePrefix,
|
||||
QFileInfoList &qmFiles) {
|
||||
|
||||
if (localePrefix.isEmpty())
|
||||
return false;
|
||||
|
||||
qDebug() << "Search for " << localePrefix;
|
||||
|
||||
const auto prefixes = localePrefix.split(QRegExp("[_-]"));
|
||||
|
||||
auto prefixIt = prefixes.begin();
|
||||
|
||||
for (const auto &location: qAsConst(_locations)) {
|
||||
qmFiles += QDir(location).entryInfoList({"*" + localePrefix + "*.qm"}, QDir::Files);
|
||||
qmFiles += QDir(location).entryInfoList({"*" + (*prefixIt).toLower() + "*.qm"}, QDir::Files);
|
||||
}
|
||||
|
||||
qDebug() << "Found" << qmFiles;
|
||||
|
||||
return qmFiles.size();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user