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):
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:
if name.lower()[-4:] == '.xml':
filename = '%s/%s'%(root,name)
filename = '%s/%s'%(rootdir,name)
tree = ET.parse(filename)
root = tree.getroot()
if root.tag == 'form':
for tag in recursiveParseForm(root):
rootObj = tree.getroot()
if rootObj.tag == 'form':
for tag in recursiveParseForm(rootObj):
yield tag
......@@ -60,15 +60,15 @@ def getTranslations(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:
if name.lower()[-4:] == '.xml':
filename = '%s/%s'%(root,name)
filename = '%s/%s'%(rootdir,name)
tree = ET.parse(filename)
root = tree.getroot()
if root.tag == 'model':
for tag in recursiveParseModel(root):
rootObj = tree.getroot()
if rootObj.tag == 'model':
for tag in recursiveParseModel(rootObj):
yield tag
elif root.tag == 'menu':
for tag in recursiveParseMenu(root):
elif rootObj.tag == 'menu':
for tag in recursiveParseMenu(rootObj):
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