Skip to content

Commit 3f8c05a

Browse files
author
jef
committedDec 20, 2009
respect overriden locale in helpviewer and fix link typo
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12536 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed
 

‎src/helpviewer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ IF (${QTVERSION} STRLESS "4.3.0")
7979
)
8080
ELSE (${QTVERSION} STRLESS "4.3.0")
8181
TARGET_LINK_LIBRARIES(qgis_help
82-
${QT_QTCORE_LIBRA}
82+
${QT_QTCORE_LIBRARY}
8383
${QT_QTGUI_LIBRARY}
8484
${QT_QTNETWORK_LIBRARY}
8585
${QT_QTSVG_LIBRARY}

‎src/helpviewer/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ int main( int argc, char ** argv )
4949
if ( myTranslationCode.isEmpty() )
5050
{
5151
myTranslationCode = QLocale::system().name();
52+
53+
QSettings settings;
54+
if( settings.value( "locale/overrideFlag", false ).toBool() )
55+
{
56+
myTranslationCode = settings.value( "locale/userLocale", "en_US" ).toString();
57+
}
5258
}
5359
QgsDebugMsg( QString( "Setting translation to %1/qgis_%2" ).arg( i18nPath ).arg( myTranslationCode ) );
5460

‎src/helpviewer/qgshelpviewer.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,14 @@ void QgsHelpViewer::loadContext( const QString &contextId )
104104
* determine the locale and create the file name from
105105
* the context id
106106
*/
107-
QString lang( QLocale::system().name() );
107+
QString lang = QLocale::system().name();
108+
109+
QSettings settings;
110+
if( settings.value( "locale/overrideFlag", false ).toBool() )
111+
{
112+
QLocale l( settings.value( "locale/userLocale", "en_US" ).toString() );
113+
lang = l.name();
114+
}
108115
/*
109116
* If the language isn't set on the system, assume en_US,
110117
* otherwise we get the banner at the top of the help file
@@ -129,7 +136,7 @@ void QgsHelpViewer::loadContext( const QString &contextId )
129136
// translate this for us message
130137
if ( !lang.contains( "en_" ) )
131138
{
132-
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 />";
139+
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 />";
133140
}
134141
}
135142
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )

0 commit comments

Comments
 (0)
Please sign in to comment.