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
Léo-Paul Géneau
erp5
Commits
be608279
Commit
be608279
authored
Jan 08, 2016
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_administration: add tool to clean up Localizer messages
parent
9b026068
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
1 deletion
+45
-1
bt5/erp5_administration/ExtensionTemplateItem/portal_components/extension.erp5.ERP5Administration.py
...em/portal_components/extension.erp5.ERP5Administration.py
+15
-0
bt5/erp5_administration/ExtensionTemplateItem/portal_components/extension.erp5.ERP5Administration.xml
...m/portal_components/extension.erp5.ERP5Administration.xml
+2
-1
bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/MessageCatalog_cleanUpMessageDict.xml
...erp5_administration/MessageCatalog_cleanUpMessageDict.xml
+28
-0
No files found.
bt5/erp5_administration/ExtensionTemplateItem/portal_components/extension.erp5.ERP5Administration.py
View file @
be608279
...
...
@@ -117,6 +117,21 @@ def MessageCatalog_deleteNotTranslatedMessageDict(self):
del
(
self
.
_messages
[
k
])
return
len
(
not_translated_message_dict
.
keys
())
def
MessageCatalog_cleanUpMessageDict
(
self
):
"""
Cleans up translation dictionnaries by removing empty values
and deleting entries without any translation from the Localizer's
MessageCatalog instance messages.
"""
count
=
0
for
k
,
v
in
self
.
_messages
.
items
():
for
lang
,
translation
in
v
.
items
():
if
len
(
translation
)
==
0
or
translation
==
k
:
del
self
.
_messages
[
k
][
lang
]
if
len
(
v
)
==
0
:
del
self
.
_messages
[
k
]
count
+=
1
return
count
def
checkConversionToolAvailability
(
self
):
"""
...
...
bt5/erp5_administration/ExtensionTemplateItem/portal_components/extension.erp5.ERP5Administration.xml
View file @
be608279
...
...
@@ -46,7 +46,8 @@
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 88, 29: map/filter on lambda could be replaced by comprehension (deprecated-lambda)
</string>
<string>
W:106, 29: map/filter on lambda could be replaced by comprehension (deprecated-lambda)
</string>
<string>
W:156, 2: No exception type(s) specified (bare-except)
</string>
</tuple>
</value>
</item>
...
...
bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/MessageCatalog_cleanUpMessageDict.xml
0 → 100644
View file @
be608279
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
MessageCatalog_cleanUpMessageDict
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
ERP5Administration
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
MessageCatalog_cleanUpMessageDict
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Cleans up translation dictionnaries by removing empty values and deleting entries without any translation from the Localizer\'s MessageCatalog instance messages.
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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