Skip to content
Permalink
Browse files

respect overriden locale in helpviewer and fix link typo

git-svn-id: http://svn.osgeo.org/qgis/trunk@12536 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Dec 20, 2009
1 parent f5007cc commit 2fe98b8902f42f2c340754cfc39508ece2cd9242
Showing with 16 additions and 3 deletions.
  1. +1 −1 src/helpviewer/CMakeLists.txt
  2. +6 −0 src/helpviewer/main.cpp
  3. +9 −2 src/helpviewer/qgshelpviewer.cpp
@@ -79,7 +79,7 @@ IF (${QTVERSION} STRLESS "4.3.0")
)
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}
@@ -49,6 +49,12 @@ int main( int argc, char ** argv )
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 ) );

@@ -104,7 +104,14 @@ void QgsHelpViewer::loadContext( const QString &contextId )
* 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 @@ void QgsHelpViewer::loadContext( const QString &contextId )
// 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 ) )

0 comments on commit 2fe98b8

Please sign in to comment.
You can’t perform that action at this time.