Skip to content

Commit

Permalink
better names for plugin help files: index-ll_CC.html or index-ll.html
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13100 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty committed Mar 20, 2010
1 parent 4f327f1 commit 798f682
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def reloadPlugin(packageName):


def showPluginHelp(packageName=None,filename="index",section=""):
""" show a help in the user's html browser. The help file should be named index-ll_CC.html or index-ll.html"""
try:
source = ""
if packageName is None:
Expand All @@ -253,10 +254,14 @@ def showPluginHelp(packageName=None,filename="index",section=""):
except:
return
path = os.path.dirname(source)
locale = str(QLocale().name()).split("_")[0]
locale = str(QLocale().name())
helpfile = os.path.join(path,filename+"-"+locale+".html")
if not os.path.exists(helpfile):
helpfile = os.path.join(path,filename+".html")
helpfile = os.path.join(path,filename+"-"+locale.split("_")[0]+".html")
if not os.path.exists(helpfile):
helpfile = os.path.join(path,filename+"-en.html")
if not os.path.exists(helpfile):
helpfile = os.path.join(path,filename+"-en_US.html")
if os.path.exists(helpfile):
url = "file://"+helpfile
if section != "":
Expand Down

0 comments on commit 798f682

Please sign in to comment.