mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-28 11:56:20 +00:00
fix(src/app/translator/DefaultTranslator): ignore qrc QtQuick files
This commit is contained in:
parent
f50be47456
commit
cf938262cb
2 changed files with 10 additions and 3 deletions
|
|
@ -92,7 +92,7 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true) {
|
||||||
}
|
}
|
||||||
|
|
||||||
App::~App () {
|
App::~App () {
|
||||||
qInfo() << "Destroying app...";
|
qInfo() << QStringLiteral("Destroying app...");
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,12 @@ DefaultTranslator::DefaultTranslator (QObject *parent) : QTranslator(parent) {
|
||||||
|
|
||||||
if (info.suffix() == "qml") {
|
if (info.suffix() == "qml") {
|
||||||
// Ignore extra selectors.
|
// Ignore extra selectors.
|
||||||
QString dir = info.absoluteDir().dirName();
|
QString dir = info.absoluteDir().absolutePath();
|
||||||
if (dir == "+linux" || dir == "+mac" || dir == "+windows")
|
if (dir.contains("+linux") || dir.contains("+mac") || dir.contains("+windows"))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Ignore default imports.
|
||||||
|
if (dir.startsWith(":/QtQuick"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString basename = info.baseName();
|
QString basename = info.baseName();
|
||||||
|
|
@ -53,6 +57,9 @@ QString DefaultTranslator::translate (
|
||||||
const char *disambiguation,
|
const char *disambiguation,
|
||||||
int n
|
int n
|
||||||
) const {
|
) const {
|
||||||
|
if (!context)
|
||||||
|
return QStringLiteral("");
|
||||||
|
|
||||||
QString translation = QTranslator::translate(context, source_text, disambiguation, n);
|
QString translation = QTranslator::translate(context, source_text, disambiguation, n);
|
||||||
|
|
||||||
if (translation.length() == 0 && m_contexts.contains(context))
|
if (translation.length() == 0 && m_contexts.contains(context))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue