]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Added improvement made in revision 1.17.2.6 :
authorouv <ouv@opencascade.com>
Tue, 22 Feb 2011 10:15:33 +0000 (10:15 +0000)
committerouv <ouv@opencascade.com>
Tue, 22 Feb 2011 10:15:33 +0000 (10:15 +0000)
SALOME internationalization: add textual resources for French language

src/Qtx/QtxResourceMgr.cxx

index f1764c024826d6a2f6ea25eb22176eae0bc214f4..63c16bf906ea15e4831f1e5650970f729b023d69 100644 (file)
@@ -27,6 +27,7 @@
 #include <QRegExp>
 #include <QTextStream>
 #include <QApplication>
+#include <QLibraryInfo>
 #ifndef QT_NO_DOM
 #include <QDomDocument>
 #include <QDomElement>
@@ -2378,6 +2379,14 @@ void QtxResourceMgr::loadLanguage( const bool loadUser, const QString& pref, con
   else
     prefixList = parameters( resSection() );
 
+  if ( pref.isEmpty() && lang != "en" ) {
+    // load Qt resources
+    QString qt_translations = QLibraryInfo::location( QLibraryInfo::TranslationsPath );
+    QTranslator* trans = new QtxTranslator( 0 );
+    if ( trans->load( QString("qt_%1").arg( lang ), qt_translations ) )
+      QApplication::instance()->installTranslator( trans );
+  }
+
   for ( QStringList::ConstIterator iter = prefixList.begin(); iter != prefixList.end(); ++iter )
   {
     QString prefix = *iter;