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
e03fc309
Commit
e03fc309
authored
Aug 03, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include old translation in notification (issue #101)
parent
32400f71
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
weblate/accounts/models.py
weblate/accounts/models.py
+2
-1
weblate/html/mail/any_translation.txt
weblate/html/mail/any_translation.txt
+4
-0
weblate/trans/models.py
weblate/trans/models.py
+4
-1
No files found.
weblate/accounts/models.py
View file @
e03fc309
...
...
@@ -139,7 +139,7 @@ class Profile(models.Model):
finally
:
translation
.
activate
(
cur_language
)
def
notify_any_translation
(
self
,
unit
):
def
notify_any_translation
(
self
,
unit
,
oldunit
):
'''
Sends notification on translation.
'''
...
...
@@ -148,6 +148,7 @@ class Profile(models.Model):
unit
.
translation
,
{
'unit'
:
unit
,
'oldunit'
:
oldunit
,
}
)
...
...
weblate/html/mail/any_translation.txt
View file @
e03fc309
...
...
@@ -11,4 +11,8 @@ there has been new translation on {{ translation }} at {{ site_title }}.
{{ unit.target }}
{% trans "Previous translation:" %}
{{ oldunit.target }}
{% endfilter%}{% endautoescape %}{% include "mail/footer.txt" %}
weblate/trans/models.py
View file @
e03fc309
...
...
@@ -1705,6 +1705,9 @@ class Unit(models.Model):
else
:
self
.
flags
=
''
# Get old unit from database (for notifications)
oldunit
=
Unit
.
objects
.
get
(
id
=
self
.
id
)
# Save updated unit to database
self
.
save
(
backend
=
True
)
...
...
@@ -1718,7 +1721,7 @@ class Unit(models.Model):
self
.
translation
.
language
)
for
subscription
in
subscriptions
:
subscription
.
notify_any_translation
(
self
)
subscription
.
notify_any_translation
(
self
,
oldunit
)
# Force commiting on completing translation
if
old_translated
<
self
.
translation
.
translated
and
self
.
translation
.
translated
==
self
.
translation
.
total
:
...
...
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