From e5fb2d37e1142a09d63d029256a61e24263bd204 Mon Sep 17 00:00:00 2001 From: borysiasty Date: Sat, 20 Mar 2010 09:50:58 +0000 Subject: [PATCH] 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 --- python/utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/utils.py b/python/utils.py index 010da046657..91406e02ac7 100644 --- a/python/utils.py +++ b/python/utils.py @@ -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: @@ -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 != "":