Skip to content

Commit

Permalink
show english help for console if translations not found
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Oct 29, 2012
1 parent d1a5bbf commit ae2c14d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
12 changes: 0 additions & 12 deletions build.xml

This file was deleted.

7 changes: 4 additions & 3 deletions python/console_help.py
Expand Up @@ -35,7 +35,7 @@ def __init__(self):
QtGui.QDialog.__init__(self)
self.setModal(True)
self.setupUi()

def setupUi(self):
self.setMaximumSize(500, 300)
self.webView = QtWebKit.QWebView()
Expand All @@ -58,15 +58,16 @@ def setupUi(self):
qgisDataDir = QgsApplication.pkgDataPath()
listFile = os.listdir(qgisDataDir + "/python/console_help/i18n")
localeFullName = QSettings().value( "locale/userLocale", QVariant( "" ) ).toString()
locale = "en_US"
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)

Expand Down

0 comments on commit ae2c14d

Please sign in to comment.