Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
b7bd4960
Commit
b7bd4960
authored
May 02, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle situation when backend did not find the message (issue #43)
parent
77f0cf38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
weblate/trans/models.py
weblate/trans/models.py
+10
-0
No files found.
weblate/trans/models.py
View file @
b7bd4960
...
...
@@ -841,10 +841,12 @@ class Translation(models.Model):
store
=
self
.
get_store
()
src
=
unit
.
get_source_plurals
()[
0
]
need_save
=
False
found
=
False
# Find all units with same source
for
pounit
in
store
.
findunits
(
src
):
# Does context match?
if
pounit
.
getcontext
()
==
unit
.
context
:
found
=
True
# Is it plural?
if
hasattr
(
pounit
.
target
,
'strings'
):
potarget
=
join_plural
(
pounit
.
target
.
strings
)
...
...
@@ -864,6 +866,9 @@ class Translation(models.Model):
# We should have only one match
break
if
not
found
:
return
False
,
None
# Save backend if there was a change
if
need_save
:
author
=
self
.
get_author_name
(
request
.
user
)
...
...
@@ -1079,6 +1084,11 @@ class Unit(models.Model):
# Store to backend
(
saved
,
pounit
)
=
self
.
translation
.
update_unit
(
self
,
request
)
# Handle situation when backend did not find the message
if
pounit
is
None
:
logger
.
error
(
'message %s disappeared!'
,
self
)
messages
.
error
(
request
,
_
(
'Message not found in backend storage, it is probably corrupted.'
))
# Update translated flag
self
.
translated
=
pounit
.
istranslated
()
...
...
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