From 5ac608f3ef675b3655ac2322ea40b07902496ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Fri, 27 Aug 2010 01:04:28 +0000 Subject: [PATCH] [GB.QT4] * BUG: Hardcode some translations directories when searching for Qt translation files: '/usr/lib/qt4/translations' and '/usr/share/qt4/translations'. git-svn-id: svn://localhost/gambas/trunk@3142 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.qt4/src/main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gb.qt4/src/main.cpp b/gb.qt4/src/main.cpp index d51ebca2f..3d610dfc6 100644 --- a/gb.qt4/src/main.cpp +++ b/gb.qt4/src/main.cpp @@ -630,10 +630,15 @@ static void init_lang(QString locale, bool rtl) if (pos >= 0) locale = locale.left(pos); qt = new QTranslator(); - if (!qt->load(QString( "qt_fr"), QString(getenv("QTDIR")) + "/translations")) + if (!qt->load(QString("qt") + locale, QString(getenv("QTDIR")) + "/translations") + && !qt->load(QString("qt") + locale, QString("/usr/lib/qt4/translations")) + && !qt->load(QString("qt") + locale, QString("/usr/share/qt4/translations"))) + { qDebug("warning: unable to load Qt translation: %s", QT_ToUTF8(locale)); - - qApp->installTranslator(qt); + } + else + qApp->installTranslator(qt); + if (rtl) qApp->setLayoutDirection(Qt::RightToLeft); }