[QGIS Commit] r12536 - trunk/qgis/src/helpviewer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Dec 20 10:14:39 EST 2009


Author: jef
Date: 2009-12-20 10:14:38 -0500 (Sun, 20 Dec 2009)
New Revision: 12536

Modified:
   trunk/qgis/src/helpviewer/CMakeLists.txt
   trunk/qgis/src/helpviewer/main.cpp
   trunk/qgis/src/helpviewer/qgshelpviewer.cpp
Log:
respect overriden locale in helpviewer and fix link typo

Modified: trunk/qgis/src/helpviewer/CMakeLists.txt
===================================================================
--- trunk/qgis/src/helpviewer/CMakeLists.txt	2009-12-20 14:38:34 UTC (rev 12535)
+++ trunk/qgis/src/helpviewer/CMakeLists.txt	2009-12-20 15:14:38 UTC (rev 12536)
@@ -79,7 +79,7 @@
     )
 ELSE (${QTVERSION} STRLESS "4.3.0")
   TARGET_LINK_LIBRARIES(qgis_help
-    ${QT_QTCORE_LIBRA} 
+    ${QT_QTCORE_LIBRARY} 
     ${QT_QTGUI_LIBRARY} 
     ${QT_QTNETWORK_LIBRARY} 
     ${QT_QTSVG_LIBRARY} 

Modified: trunk/qgis/src/helpviewer/main.cpp
===================================================================
--- trunk/qgis/src/helpviewer/main.cpp	2009-12-20 14:38:34 UTC (rev 12535)
+++ trunk/qgis/src/helpviewer/main.cpp	2009-12-20 15:14:38 UTC (rev 12536)
@@ -49,6 +49,12 @@
   if ( myTranslationCode.isEmpty() )
   {
     myTranslationCode = QLocale::system().name();
+
+    QSettings settings;
+    if( settings.value( "locale/overrideFlag", false ).toBool() )
+    {
+      myTranslationCode = settings.value( "locale/userLocale", "en_US" ).toString();
+    }
   }
   QgsDebugMsg( QString( "Setting translation to %1/qgis_%2" ).arg( i18nPath ).arg( myTranslationCode ) );
 

Modified: trunk/qgis/src/helpviewer/qgshelpviewer.cpp
===================================================================
--- trunk/qgis/src/helpviewer/qgshelpviewer.cpp	2009-12-20 14:38:34 UTC (rev 12535)
+++ trunk/qgis/src/helpviewer/qgshelpviewer.cpp	2009-12-20 15:14:38 UTC (rev 12536)
@@ -104,7 +104,14 @@
      * determine the locale and create the file name from
      * the context id
      */
-    QString lang( QLocale::system().name() );
+    QString lang = QLocale::system().name();
+
+    QSettings settings;
+    if( settings.value( "locale/overrideFlag", false ).toBool() )
+    {
+       QLocale l( settings.value( "locale/userLocale", "en_US" ).toString() );
+       lang = l.name();
+    }
     /*
      * If the language isn't set on the system, assume en_US,
      * otherwise we get the banner at the top of the help file
@@ -129,7 +136,7 @@
       // translate this for us message
       if ( !lang.contains( "en_" ) )
       {
-        helpContents = "<i>" + tr( "This help file is not available in your language. If you would like to translate it, please contact the QGIS  development team." ) + "</i><hr />";
+        helpContents = "<i>" + tr( "This help file is not available in your language %1. If you would like to translate it, please contact the QGIS  development team." ).arg( lang ) + "</i><hr />";
       }
     }
     if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )



More information about the QGIS-commit mailing list