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
bb985b98
Commit
bb985b98
authored
Jul 23, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented notifications for translations (issue #59)
parent
e10b8acd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
weblate/accounts/models.py
weblate/accounts/models.py
+2
-2
weblate/trans/models.py
weblate/trans/models.py
+8
-0
weblate/trans/views.py
weblate/trans/views.py
+6
-0
No files found.
weblate/accounts/models.py
View file @
bb985b98
...
...
@@ -137,13 +137,13 @@ class Profile(models.Model):
finally
:
translation
.
activate
(
cur_language
)
def
notify_any_translation
(
self
,
translation
,
unit
):
def
notify_any_translation
(
self
,
unit
):
'''
Sends notification on translation.
'''
self
.
notify_user
(
'any_translation'
,
translation
,
unit
.
translation
,
{
'unit'
:
unit
,
}
...
...
weblate/trans/models.py
View file @
bb985b98
...
...
@@ -1638,6 +1638,14 @@ 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 @
bb985b98
...
...
@@ -739,6 +739,12 @@ 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
profile
.
save
()
...
...
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