Commit 5c29e4b0 authored by Franco Fichtner's avatar Franco Fichtner

scripts: sweep here too

parent c9933aa0
......@@ -37,6 +37,8 @@ sweep: force
xargs -0 -n1 scripts/cleanfile
find ${.CURDIR}/pkg -type f -print0 | \
xargs -0 -n1 scripts/cleanfile
find ${.CURDIR}/scripts -type f -print0 | \
xargs -0 -n1 scripts/cleanfile
style: force
@(phpcs --tab-width=4 --standard=PSR2 ${.CURDIR}/src/opnsense/mvc \
......
......@@ -51,13 +51,12 @@ for filename in glob.glob('%s/plugins/*.py'%'/'.join(os.path.realpath(__file__).
lang = importlib.import_module('plugins.%s'%modulename)
if hasattr(lang,'getTranslations'):
# open filehandle for collected plugin
fOut=open('%s/%s.php'%(targetPath,modulename),'w')
fOut=open('%s/%s.php'%(targetPath,modulename),'w')
fOut.write(templateText)
# fill with gettext tags
for textValue in lang.getTranslations(OPNsenseRoot):
line="echo gettext('%s');\n"%(unicode(textValue).replace("'","\\'"))
fOut.write(line)
fOut.close()
fOut.close()
......@@ -28,7 +28,7 @@
--------------------------------------------------------------------------------------
package : translate
function: collect acl translatable text
function: collect acl translatable text
......@@ -39,9 +39,7 @@ def getTranslations(root):
import json
filename='%s/opnsense/mvc/app/models/OPNsense/Core/ACL_Legacy_Page_Map.json'%root
aclMap = json.loads(open(filename).read())
for aclKey in aclMap.keys():
if aclMap[aclKey].has_key('descr'):
yield aclMap[aclKey]['descr']
......@@ -32,4 +32,3 @@
* Language support, autogenerated file
*
*/
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