]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Internationalization: fix problem of Qt resources loading when qt library is copied...
authorvsr <vsr@opencascade.com>
Thu, 24 Feb 2011 14:47:25 +0000 (14:47 +0000)
committervsr <vsr@opencascade.com>
Thu, 24 Feb 2011 14:47:25 +0000 (14:47 +0000)
src/Qtx/QtxResourceMgr.cxx

index 1dbef97aef17b3856bfc3f26a9b77f4be9b46011..39f93cb055b53585e730e6a818ddaf40d27268e7 100644 (file)
@@ -2594,8 +2594,14 @@ void QtxResourceMgr::loadLanguage( const QString& pref, const QString& l )
   if ( pref.isEmpty() && lang != "en" ) {
     // load Qt resources
     QString qt_translations = QLibraryInfo::location( QLibraryInfo::TranslationsPath );
+    QString qt_dir_trpath;
+    if ( ::getenv( "QTDIR" ) )
+      qt_dir_trpath = QString( ::getenv( "QTDIR" ) );
+    if ( !qt_dir_trpath.isEmpty() )
+      qt_dir_trpath = QDir( qt_dir_trpath ).absoluteFilePath( "translations" );
+
     QTranslator* trans = new QtxTranslator( 0 );
-    if ( trans->load( QString("qt_%1").arg( lang ), qt_translations ) )
+    if ( trans->load( QString("qt_%1").arg( lang ), qt_translations ) || trans->load( QString("qt_%1").arg( lang ), qt_dir_trpath ) )
       QApplication::instance()->installTranslator( trans );
   }