Skip to content

Commit e5fb2d3

Browse files
author
borysiasty
committedMar 20, 2010
better names for plugin help files: index-ll_CC.html or index-ll.html
git-svn-id: http://svn.osgeo.org/qgis/trunk@13100 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 515393e commit e5fb2d3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎python/utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ def reloadPlugin(packageName):
243243

244244

245245
def showPluginHelp(packageName=None,filename="index",section=""):
246+
""" show a help in the user's html browser. The help file should be named index-ll_CC.html or index-ll.html"""
246247
try:
247248
source = ""
248249
if packageName is None:
@@ -253,10 +254,14 @@ def showPluginHelp(packageName=None,filename="index",section=""):
253254
except:
254255
return
255256
path = os.path.dirname(source)
256-
locale = str(QLocale().name()).split("_")[0]
257+
locale = str(QLocale().name())
257258
helpfile = os.path.join(path,filename+"-"+locale+".html")
258259
if not os.path.exists(helpfile):
259-
helpfile = os.path.join(path,filename+".html")
260+
helpfile = os.path.join(path,filename+"-"+locale.split("_")[0]+".html")
261+
if not os.path.exists(helpfile):
262+
helpfile = os.path.join(path,filename+"-en.html")
263+
if not os.path.exists(helpfile):
264+
helpfile = os.path.join(path,filename+"-en_US.html")
260265
if os.path.exists(helpfile):
261266
url = "file://"+helpfile
262267
if section != "":

0 commit comments

Comments
 (0)
Please sign in to comment.