Commit ebecb761 authored by Ad Schellevis's avatar Ad Schellevis

(lang) fix language collector scripts (model/controller)

parent 82a4ebb4
...@@ -51,12 +51,12 @@ def getTranslations(root): ...@@ -51,12 +51,12 @@ def getTranslations(root):
rootpath='%s/opnsense/mvc/app/controllers/'%root rootpath='%s/opnsense/mvc/app/controllers/'%root
for root, dirs, files in os.walk(rootpath, topdown=False): for rootdir, dirs, files in os.walk(rootpath, topdown=False):
for name in files: for name in files:
if name.lower()[-4:] == '.xml': if name.lower()[-4:] == '.xml':
filename = '%s/%s'%(root,name) filename = '%s/%s'%(rootdir,name)
tree = ET.parse(filename) tree = ET.parse(filename)
root = tree.getroot() rootObj = tree.getroot()
if root.tag == 'form': if rootObj.tag == 'form':
for tag in recursiveParseForm(root): for tag in recursiveParseForm(rootObj):
yield tag yield tag
...@@ -60,15 +60,15 @@ def getTranslations(root): ...@@ -60,15 +60,15 @@ def getTranslations(root):
rootpath='%s/opnsense/mvc/app/models/'%root rootpath='%s/opnsense/mvc/app/models/'%root
for root, dirs, files in os.walk(rootpath, topdown=False): for rootdir, dirs, files in os.walk(rootpath, topdown=False):
for name in files: for name in files:
if name.lower()[-4:] == '.xml': if name.lower()[-4:] == '.xml':
filename = '%s/%s'%(root,name) filename = '%s/%s'%(rootdir,name)
tree = ET.parse(filename) tree = ET.parse(filename)
root = tree.getroot() rootObj = tree.getroot()
if root.tag == 'model': if rootObj.tag == 'model':
for tag in recursiveParseModel(root): for tag in recursiveParseModel(rootObj):
yield tag yield tag
elif root.tag == 'menu': elif rootObj.tag == 'menu':
for tag in recursiveParseMenu(root): for tag in recursiveParseMenu(rootObj):
yield tag yield tag
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment