Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tev
plugin_event
Commits
1b0f316e
Commit
1b0f316e
authored
Dec 15, 2016
by
LE GAC Renaud
Browse files
Activate the lazy Translation.
parent
c4ed0ca7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
14 deletions
+21
-14
models/common_settings.py
models/common_settings.py
+1
-1
modules/plugin_event/ui_viewport.py
modules/plugin_event/ui_viewport.py
+20
-13
No files found.
models/common_settings.py
View file @
1b0f316e
...
...
@@ -25,7 +25,7 @@ fnct = request.function
T
.
set_current_languages
(
"en"
,
"en-gb"
,
"en-us"
)
# mother tongue
T
.
force
(
"fr-fr"
)
# user language
T
.
lazy
=
False
#
immediate
translation
T
.
lazy
=
True
#
lazy
translation
#.............................................................................
#
...
...
modules/plugin_event/ui_viewport.py
View file @
1b0f316e
...
...
@@ -108,10 +108,13 @@ class ViewportUi(object):
node
=
Node
(
T
(
"Help"
))
# NOTE
# Immediate translation is required by node.short_children
add_child
=
node
.
add_child
add_child
(
T
(
"about"
),
about_panel
)
add_child
(
T
(
"documentations"
),
doc_panel
)
add_child
(
T
(
"versions"
),
version_panel
)
add_child
(
T
(
"about"
,
lazy
=
False
),
about_panel
)
add_child
(
T
(
"documentations"
,
lazy
=
False
),
doc_panel
)
add_child
(
T
(
"versions"
,
lazy
=
False
),
version_panel
)
node
.
sort_children
()
...
...
@@ -173,11 +176,14 @@ class ViewportUi(object):
"""
node
=
Node
(
T
(
"Metadata"
))
# NOTE
# Immediate translation is required by node.short_children
add_child
=
node
.
add_child
add_child
(
T
(
"domains"
),
to_grid
(
db
.
domains
))
add_child
(
T
(
"fundings"
),
to_grid
(
db
.
fundings
))
add_child
(
T
(
"teams"
),
to_grid
(
db
.
teams
))
add_child
(
T
(
"projects"
),
to_grid
(
db
.
projects
))
add_child
(
T
(
"domains"
,
lazy
=
False
),
to_grid
(
db
.
domains
))
add_child
(
T
(
"fundings"
,
lazy
=
False
),
to_grid
(
db
.
fundings
))
add_child
(
T
(
"teams"
,
lazy
=
False
),
to_grid
(
db
.
teams
))
add_child
(
T
(
"projects"
,
lazy
=
False
),
to_grid
(
db
.
projects
))
node
.
sort_children
()
...
...
@@ -197,11 +203,14 @@ class ViewportUi(object):
"""
node
=
Node
(
T
(
"People and objects"
))
# NOTE
# Immediate translation is required by node.short_children
add_child
=
node
.
add_child
add_child
(
T
(
"people"
),
to_grid
(
db
.
people
))
add_child
(
T
(
"people_categories"
),
to_grid
(
db
.
people_categories
))
add_child
(
T
(
"objects"
),
to_grid
(
db
.
objects
))
add_child
(
T
(
"object_categories"
),
to_grid
(
db
.
object_categories
))
add_child
(
T
(
"people"
,
lazy
=
False
),
to_grid
(
db
.
people
))
add_child
(
T
(
"people_categories"
,
lazy
=
False
),
to_grid
(
db
.
people_categories
))
add_child
(
T
(
"objects"
,
lazy
=
False
),
to_grid
(
db
.
objects
))
add_child
(
T
(
"object_categories"
,
lazy
=
False
),
to_grid
(
db
.
object_categories
))
node
.
sort_children
()
...
...
@@ -261,7 +270,6 @@ class ViewportUi(object):
add_child
(
row
.
name
,
panel
)
node
.
sort_children
()
return
node
@
staticmethod
...
...
@@ -290,7 +298,6 @@ class ViewportUi(object):
node
.
add_child
(
row
.
name
,
panel
)
node
.
sort_children
()
return
node
@
staticmethod
...
...
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