From 76e51faca1cdda7abf25af7dbebc8f149ad00849 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Fri, 24 Jul 2009 01:11:41 +0200 Subject: [PATCH] search translations from install on Linux --- src/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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); -- 2.39.5