Allow (partial) translations even when run from build dir
authorDaniel Molkentin <danimo@owncloud.com>
Wed, 9 Sep 2015 23:25:16 +0000 (01:25 +0200)
committerDaniel Molkentin <danimo@owncloud.com>
Wed, 9 Sep 2015 23:25:16 +0000 (01:25 +0200)
Makes it easier to catch translation issues earlier

src/gui/application.cpp

index 2bcafee6e3b215867fe0f639727e717a16ca85ce..b8839d691f40d31b3bec08c01e1da1e2b8514ab5 100644 (file)
@@ -71,6 +71,12 @@ static const char optionsC[] =
 
 QString applicationTrPath()
 {
+    QString devTrPath = qApp->applicationDirPath() + QString::fromLatin1("/../src/gui/");
+    if (QDir(devTrPath).exists()) {
+        // might miss Qt, QtKeyChain, etc.
+        qDebug() << "Running from build location! Translations may be incomplete!";
+        return devTrPath;
+    }
 #if defined(Q_OS_WIN)
    return QApplication::applicationDirPath();
 #elif defined(Q_OS_MAC)