* 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
This commit is contained in:
Benoît Minisini 2010-08-27 01:04:28 +00:00
parent 27ce882d1e
commit 5ac608f3ef

View file

@ -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);
}