From: Flavio Tordini Date: Thu, 23 Jul 2009 23:11:41 +0000 (+0200) Subject: search translations from install on Linux X-Git-Tag: 0.5~21 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=76e51faca1cdda7abf25af7dbebc8f149ad00849;p=minitube search translations from install on Linux --- diff --git a/src/main.cpp b/src/main.cpp index fb50341..ce8c76a 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -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);