Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Graydon
erp5
Commits
9d839e52
Commit
9d839e52
authored
Aug 18, 2022
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! erp5_web: introduce translatable path.
parent
0ea77886
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
bt5/erp5_web/DocumentTemplateItem/portal_components/document.erp5.WebSection.py
...emplateItem/portal_components/document.erp5.WebSection.py
+4
-3
No files found.
bt5/erp5_web/DocumentTemplateItem/portal_components/document.erp5.WebSection.py
View file @
9d839e52
...
...
@@ -28,6 +28,7 @@
##############################################################################
import
re
import
six
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
erp5.component.document.Domain
import
Domain
...
...
@@ -166,14 +167,14 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
def
_getTranslatedPathDict
(
self
):
return
getattr
(
self
,
INTERNAL_TRANSLATED_PATH_DICT_NAME
,
{})
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'updateTranslated
WebSectionLis
t'
)
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'updateTranslated
PathDic
t'
)
def
updateTranslatedPathDict
(
self
,
recursive
=
False
):
translated_path_dict
=
{}
available_language_list
=
self
.
getAvailableLanguageList
()
for
section
in
self
.
objectValues
(
portal_type
=
'Web Section'
):
section_id
=
section
.
getId
()
translated_section_id_dict
=
dict
((
k
[
1
],
v
[
1
])
for
k
,
v
in
section
.
_getTranslationDict
().
items
(
)
\
if
k
[
0
]
==
'translatable_id'
and
v
[
0
]
==
section_id
)
translated_section_id_dict
=
{
k
[
1
]:
v
[
1
]
for
k
,
v
in
six
.
iteritems
(
section
.
_getTranslationDict
()
)
\
if
k
[
0
]
==
'translatable_id'
and
v
[
0
]
==
section_id
}
for
language
in
available_language_list
:
translated_section_id
=
translated_section_id_dict
.
get
(
language
,
section_id
)
checkValidId
(
self
,
translated_section_id
,
allow_dup
=
True
)
...
...
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