mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
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
This commit is contained in:
parent
515393ea81
commit
e5fb2d37e1
@ -243,6 +243,7 @@ def reloadPlugin(packageName):
|
|||||||
|
|
||||||
|
|
||||||
def showPluginHelp(packageName=None,filename="index",section=""):
|
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:
|
try:
|
||||||
source = ""
|
source = ""
|
||||||
if packageName is None:
|
if packageName is None:
|
||||||
@ -253,10 +254,14 @@ def showPluginHelp(packageName=None,filename="index",section=""):
|
|||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
path = os.path.dirname(source)
|
path = os.path.dirname(source)
|
||||||
locale = str(QLocale().name()).split("_")[0]
|
locale = str(QLocale().name())
|
||||||
helpfile = os.path.join(path,filename+"-"+locale+".html")
|
helpfile = os.path.join(path,filename+"-"+locale+".html")
|
||||||
if not os.path.exists(helpfile):
|
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):
|
if os.path.exists(helpfile):
|
||||||
url = "file://"+helpfile
|
url = "file://"+helpfile
|
||||||
if section != "":
|
if section != "":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user