]> git.sur5r.net Git - minitube/commitdiff
search translations from install on Linux
authorFlavio Tordini <flavio.tordini@gmail.com>
Thu, 23 Jul 2009 23:11:41 +0000 (01:11 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Thu, 23 Jul 2009 23:11:41 +0000 (01:11 +0200)
src/main.cpp

index fb50341c45740733c015a732e83941dfafb442bc..ce8c76afd5b4e4004c04bc7579d4636ce8d3afa6 100755 (executable)
@@ -21,9 +21,13 @@ int main(int argc, char **argv) {
                       QLibraryInfo::location(QLibraryInfo::TranslationsPath));
     app.installTranslator(&qtTranslator);
 
-    // translations
-    QString localeDir = QCoreApplication::applicationDirPath()
-                        + QDir::separator() + "locale";
+    // app translations
+    QString dataDir = QLatin1String(PKGDATADIR);
+    QString localeDir = dataDir + QDir::separator() + "locale";
+    // if app was not "installed" use the app directory
+    if (!QFile::exists(localeDir)) {
+        dataDir = qApp->applicationDirPath() + QDir::separator() + "locale";
+    }
     QTranslator translator;
     translator.load(locale, localeDir);
     app.installTranslator(&translator);