Skip to content
Permalink
Browse files

Merge pull request #284 from slarosa/master

improvement for detection language in console_help
  • Loading branch information
brushtyler committed Oct 10, 2012
2 parents 552703a + 3c50290 commit 1ff42b2ec1ca7a62d3c0e496657a7ddc4825978b
@@ -55,11 +55,17 @@ def setupUi(self):
QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), self.closeWindow)
self.verticalLayout.addLayout(self.horizontalLayout)
self.setLayout(self.verticalLayout)
jQueryPath = QgsApplication.pkgDataPath()
qgisDataDir = QgsApplication.pkgDataPath()
listFile = os.listdir(qgisDataDir + "/python/console_help/i18n")
localeFullName = QSettings().value( "locale/userLocale", QVariant( "" ) ).toString()
filename = QgsApplication.pkgDataPath() + "/python/console_help/help.htm? \
lang=" + localeFullName \
+ "&pkgDir=" + jQueryPath
for i in listFile:
lang = i[0:5]
if localeFullName in (lang[0:2], lang):
locale = lang

filename = qgisDataDir + "/python/console_help/help.htm? \
lang=" + locale \
+ "&pkgDir=" + qgisDataDir

url = QtCore.QUrl(filename)
self.webView.load(url)
@@ -147,7 +147,7 @@ <h4 id="thanks">Acknowledgments</h4>
var locale = langPathParameters[0].split("=");
var jQueryPath = langPathParameters[1].split("=");
var pathJs = jQueryPath[1];
var lang = locale[1].split("_")[0];
var lang = locale[1];
var jquery = document.createElement("script");
jquery.type = "text/javascript";
jquery.src = pathJs + "/resources/jQuery/jquery-1.8.2.min.js";
@@ -1,6 +1,11 @@
You can contribute at translate this help by creating an file *.properties named like
*.ts files (only the locale suffix) which found in Quantum-GIS\i18n directory.
For example: for Italian translation copy and paste a *.properties file and rename it to "it.properties".
You can contribute at translate this help by creating an file *.properties and name it in
<your_locale_name>.properties
To get your locale name type the following lines in console:

>>> from PyQt4.QtCore import *
>>> QLocale.system().name()

For example: for Italian translation copy and paste a *.properties file and rename it to "it_IT.properties".
The only thing what you have to do is translate the values of the keys in dictionary.

i18n_dict = {
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1ff42b2

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