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
Laurent S
erp5
Commits
e1cd1b6d
Commit
e1cd1b6d
authored
Jun 21, 2012
by
Leonardo Rochael Almeida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MessageCatalog: on import, convert old non-unicode msgids
If they coincide with imported keys.
parent
ceb3d411
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
product/Localizer/MessageCatalog.py
product/Localizer/MessageCatalog.py
+9
-3
No files found.
product/Localizer/MessageCatalog.py
View file @
e1cd1b6d
...
@@ -633,9 +633,15 @@ class MessageCatalog(LanguageManager, ObjectManager, SimpleItem):
...
@@ -633,9 +633,15 @@ class MessageCatalog(LanguageManager, ObjectManager, SimpleItem):
msgid
=
to_unicode
(
entry
.
msgid
,
encoding
=
encoding
)
msgid
=
to_unicode
(
entry
.
msgid
,
encoding
=
encoding
)
if
msgid
:
if
msgid
:
msgstr
=
to_unicode
(
entry
.
msgstr
or
''
,
encoding
=
encoding
)
msgstr
=
to_unicode
(
entry
.
msgstr
or
''
,
encoding
=
encoding
)
if
not
messages
.
has_key
(
msgid
):
translation_map
=
messages
.
get
(
msgid
)
messages
[
msgid
]
=
PersistentMapping
()
if
translation_map
is
None
:
messages
[
msgid
][
lang
]
=
msgstr
# convert old non-unicode translations if they exist:
translation_map
=
messages
.
pop
(
self
.
get_message_key
(
msgid
),
None
)
if
translation_map
is
None
:
translation_map
=
PersistentMapping
()
messages
[
msgid
]
=
translation_map
translation_map
[
lang
]
=
msgstr
# Set the encoding (the full header should be loaded XXX)
# Set the encoding (the full header should be loaded XXX)
self
.
update_po_header
(
lang
,
charset
=
encoding
)
self
.
update_po_header
(
lang
,
charset
=
encoding
)
...
...
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