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
629fb1aa
Commit
629fb1aa
authored
Jul 23, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move new translation notifications to single place
parent
bb985b98
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
weblate/trans/models.py
weblate/trans/models.py
+12
-8
weblate/trans/views.py
weblate/trans/views.py
+0
-5
No files found.
weblate/trans/models.py
View file @
629fb1aa
...
...
@@ -1478,6 +1478,9 @@ class Unit(models.Model):
logger
.
error
(
'message %s disappeared!'
,
self
)
messages
.
error
(
request
,
_
(
'Message not found in backend storage, it is probably corrupted.'
))
if
not
saved
:
return
# Update translated flag
self
.
translated
=
pounit
.
istranslated
()
...
...
@@ -1494,6 +1497,15 @@ class Unit(models.Model):
old_translated
=
self
.
translation
.
translated
self
.
translation
.
update_stats
()
# Notify subscribed users about new translation
from
weblate.accounts.models
import
Profile
subscriptions
=
Profile
.
objects
.
subscribed_any_translation
(
self
.
translation
.
subproject
.
project
,
self
.
translation
.
language
)
for
subscription
in
subscriptions
:
subscription
.
notify_any_translation
(
self
)
# Force commiting on completing translation
if
old_translated
<
self
.
translation
.
translated
and
self
.
translation
.
translated
==
self
.
translation
.
total
:
self
.
translation
.
commit_pending
()
...
...
@@ -1638,14 +1650,6 @@ class Suggestion(models.Model):
unit
.
target
=
self
.
target
unit
.
fuzzy
=
False
unit
.
save_backend
(
request
,
False
)
# Notify subscribed users
from
weblate.accounts.models
import
Profile
subscriptions
=
Profile
.
objects
.
subscribed_any_translation
(
unit
.
translation
.
subproject
.
project
,
unit
.
translation
.
language
)
for
subscription
in
subscriptions
:
subscription
.
notify_any_translation
(
unit
)
def
get_matching_unit
(
self
):
'''
...
...
weblate/trans/views.py
View file @
629fb1aa
...
...
@@ -739,11 +739,6 @@ def translate(request, project, subproject, lang):
unit
.
target
=
join_plural
(
form
.
cleaned_data
[
'target'
])
unit
.
fuzzy
=
form
.
cleaned_data
[
'fuzzy'
]
unit
.
save_backend
(
request
)
# Notify subscribed users
from
weblate.accounts.models
import
Profile
subscriptions
=
Profile
.
objects
.
subscribed_any_translation
(
obj
.
subproject
.
project
,
obj
.
language
)
for
subscription
in
subscriptions
:
subscription
.
notify_any_translation
(
unit
)
# Update stats
profile
.
translated
+=
1
...
...
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