Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
5c29e4b0
Commit
5c29e4b0
authored
May 12, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scripts: sweep here too
parent
c9933aa0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
9 deletions
+7
-9
Makefile
Makefile
+2
-0
collect.py
scripts/translate/collect.py
+3
-4
acl.py
scripts/translate/plugins/acl.py
+2
-4
template.txt
scripts/translate/template.txt
+0
-1
No files found.
Makefile
View file @
5c29e4b0
...
@@ -37,6 +37,8 @@ sweep: force
...
@@ -37,6 +37,8 @@ sweep: force
xargs
-0
-n1
scripts/cleanfile
xargs
-0
-n1
scripts/cleanfile
find
${
.CURDIR
}
/pkg
-type
f
-print0
|
\
find
${
.CURDIR
}
/pkg
-type
f
-print0
|
\
xargs
-0
-n1
scripts/cleanfile
xargs
-0
-n1
scripts/cleanfile
find
${
.CURDIR
}
/scripts
-type
f
-print0
|
\
xargs
-0
-n1
scripts/cleanfile
style
:
force
style
:
force
@
(
phpcs
--tab-width
=
4
--standard
=
PSR2
${
.CURDIR
}
/src/opnsense/mvc
\
@
(
phpcs
--tab-width
=
4
--standard
=
PSR2
${
.CURDIR
}
/src/opnsense/mvc
\
...
...
scripts/translate/collect.py
View file @
5c29e4b0
...
@@ -51,13 +51,12 @@ for filename in glob.glob('%s/plugins/*.py'%'/'.join(os.path.realpath(__file__).
...
@@ -51,13 +51,12 @@ for filename in glob.glob('%s/plugins/*.py'%'/'.join(os.path.realpath(__file__).
lang
=
importlib
.
import_module
(
'plugins.
%
s'
%
modulename
)
lang
=
importlib
.
import_module
(
'plugins.
%
s'
%
modulename
)
if
hasattr
(
lang
,
'getTranslations'
):
if
hasattr
(
lang
,
'getTranslations'
):
# open filehandle for collected plugin
# open filehandle for collected plugin
fOut
=
open
(
'
%
s/
%
s.php'
%
(
targetPath
,
modulename
),
'w'
)
fOut
=
open
(
'
%
s/
%
s.php'
%
(
targetPath
,
modulename
),
'w'
)
fOut
.
write
(
templateText
)
fOut
.
write
(
templateText
)
# fill with gettext tags
# fill with gettext tags
for
textValue
in
lang
.
getTranslations
(
OPNsenseRoot
):
for
textValue
in
lang
.
getTranslations
(
OPNsenseRoot
):
line
=
"echo gettext('
%
s');
\n
"
%
(
unicode
(
textValue
)
.
replace
(
"'"
,
"
\\
'"
))
line
=
"echo gettext('
%
s');
\n
"
%
(
unicode
(
textValue
)
.
replace
(
"'"
,
"
\\
'"
))
fOut
.
write
(
line
)
fOut
.
write
(
line
)
fOut
.
close
()
fOut
.
close
()
scripts/translate/plugins/acl.py
View file @
5c29e4b0
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
package : translate
package : translate
function: collect acl translatable text
function: collect acl translatable text
...
@@ -39,9 +39,7 @@ def getTranslations(root):
...
@@ -39,9 +39,7 @@ def getTranslations(root):
import
json
import
json
filename
=
'
%
s/opnsense/mvc/app/models/OPNsense/Core/ACL_Legacy_Page_Map.json'
%
root
filename
=
'
%
s/opnsense/mvc/app/models/OPNsense/Core/ACL_Legacy_Page_Map.json'
%
root
aclMap
=
json
.
loads
(
open
(
filename
)
.
read
())
aclMap
=
json
.
loads
(
open
(
filename
)
.
read
())
for
aclKey
in
aclMap
.
keys
():
for
aclKey
in
aclMap
.
keys
():
if
aclMap
[
aclKey
]
.
has_key
(
'descr'
):
if
aclMap
[
aclKey
]
.
has_key
(
'descr'
):
yield
aclMap
[
aclKey
][
'descr'
]
yield
aclMap
[
aclKey
][
'descr'
]
scripts/translate/template.txt
View file @
5c29e4b0
...
@@ -32,4 +32,3 @@
...
@@ -32,4 +32,3 @@
* Language support, autogenerated file
* Language support, autogenerated file
*
*
*/
*/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment