-
-
Notifications
You must be signed in to change notification settings - Fork 971
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(notifications): Added translation notifications (#11712)
Added a new notification for: - when all the languages in component are translated. - when a language is translated. * fix(template): applied changes in translated_language template * fix(testsuite): updated notification subscription count * fix(test_notifications): Updated notify_language_translated to use same scope as global * fix(tasks): refactored code and reverted relocation of change to component * fix(notifications): removed get_context from LanguageTranslatedNotificaton * fix(testsuite): updated subscription set count in test_watch * fix(test_notifications): updated to use same scope as real code Fixes #4294 and #11215 Co-authored-by: Manuel Cruz <manuelmcruz@tecnico.ulisboa.pt> Co-authored-by: Benjamin Alan Jamie <benjamin@weblate.org> Co-authored-by: Michal Čihař <michal@cihar.com>
- Loading branch information
1 parent
1152ebb
commit 8462ccc
Showing
11 changed files
with
229 additions
and
3 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
weblate/accounts/migrations/0011_alter_subscription_notification.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Copyright © Michal Čihař <michal@weblate.org> | ||
|
||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
# Generated by Django 5.0.6 on 2024-06-19 16:01 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("accounts", "0010_alter_subscription_notification"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="subscription", | ||
name="notification", | ||
field=models.CharField( | ||
choices=[ | ||
( | ||
"RepositoryNotification", | ||
"Operation was performed in the repository", | ||
), | ||
("LockNotification", "Component was locked or unlocked"), | ||
("LicenseNotification", "License was changed"), | ||
("ParseErrorNotification", "Parse error occurred"), | ||
("NewStringNotificaton", "String is available for translation"), | ||
( | ||
"NewContributorNotificaton", | ||
"Contributor made their first translation", | ||
), | ||
("NewSuggestionNotificaton", "Suggestion was added"), | ||
("LanguageTranslatedNotificaton", "Language was translated"), | ||
("ComponentTranslatedNotificaton", "Component was translated"), | ||
("NewCommentNotificaton", "Comment was added"), | ||
("MentionCommentNotificaton", "You were mentioned in a comment"), | ||
( | ||
"LastAuthorCommentNotificaton", | ||
"Your translation received a comment", | ||
), | ||
("TranslatedStringNotificaton", "String was edited by user"), | ||
("ApprovedStringNotificaton", "String was approved"), | ||
("ChangedStringNotificaton", "String was changed"), | ||
( | ||
"NewTranslationNotificaton", | ||
"New language was added or requested", | ||
), | ||
( | ||
"NewComponentNotificaton", | ||
"New translation component was created", | ||
), | ||
("NewAnnouncementNotificaton", "Announcement was published"), | ||
("NewAlertNotificaton", "New alert emerged in a component"), | ||
("MergeFailureNotification", "Repository operation failed"), | ||
("PendingSuggestionsNotification", "Pending suggestions exist"), | ||
("ToDoStringsNotification", "Unfinished strings exist"), | ||
], | ||
max_length=100, | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% extends "mail/base.html" %} | ||
|
||
{% block content %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% load i18n %} | ||
{% autoescape off %} | ||
{% blocktrans %}Translations in all languages have been completed in {{ component }}{% endblocktrans %} | ||
{% endautoescape %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% extends "mail/base.html" %} | ||
|
||
{% block content %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% load i18n %} | ||
{% autoescape off %} | ||
{% blocktrans %}{{translation}} has been completed{% endblocktrans %} | ||
{% endautoescape %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Copyright © Michal Čihař <michal@weblate.org> | ||
|
||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
# Generated by Django 5.0.6 on 2024-06-19 16:09 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("trans", "0018_merge_20240529_1359"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="change", | ||
name="action", | ||
field=models.IntegerField( | ||
choices=[ | ||
(0, "Resource updated"), | ||
(1, "Translation completed"), | ||
(2, "Translation changed"), | ||
(5, "Translation added"), | ||
(3, "Comment added"), | ||
(4, "Suggestion added"), | ||
(6, "Automatically translated"), | ||
(7, "Suggestion accepted"), | ||
(8, "Translation reverted"), | ||
(9, "Translation uploaded"), | ||
(13, "Source string added"), | ||
(14, "Component locked"), | ||
(15, "Component unlocked"), | ||
(17, "Changes committed"), | ||
(18, "Changes pushed"), | ||
(19, "Repository reset"), | ||
(20, "Repository merged"), | ||
(21, "Repository rebased"), | ||
(22, "Repository merge failed"), | ||
(23, "Repository rebase failed"), | ||
(28, "Repository push failed"), | ||
(24, "Parsing failed"), | ||
(25, "Translation removed"), | ||
(26, "Suggestion removed"), | ||
(27, "Translation replaced"), | ||
(29, "Suggestion removed during cleanup"), | ||
(30, "Source string changed"), | ||
(31, "String added"), | ||
(32, "Bulk status changed"), | ||
(33, "Visibility changed"), | ||
(34, "User added"), | ||
(35, "User removed"), | ||
(36, "Translation approved"), | ||
(37, "Marked for edit"), | ||
(38, "Component removed"), | ||
(39, "Project removed"), | ||
(41, "Project renamed"), | ||
(42, "Component renamed"), | ||
(43, "Moved component"), | ||
(45, "Contributor joined"), | ||
(46, "Announcement posted"), | ||
(47, "Alert triggered"), | ||
(48, "Language added"), | ||
(49, "Language requested"), | ||
(50, "Project created"), | ||
(51, "Component created"), | ||
(52, "User invited"), | ||
(53, "Repository notification received"), | ||
(54, "Translation replaced file by upload"), | ||
(55, "License changed"), | ||
(56, "Contributor agreement changed"), | ||
(57, "Screenshot added"), | ||
(58, "Screenshot uploaded"), | ||
(59, "String updated in the repository"), | ||
(60, "Add-on installed"), | ||
(61, "Add-on configuration changed"), | ||
(62, "Add-on uninstalled"), | ||
(63, "String removed"), | ||
(64, "Comment removed"), | ||
(65, "Comment resolved"), | ||
(66, "Explanation updated"), | ||
(67, "Category removed"), | ||
(68, "Category renamed"), | ||
(69, "Category moved"), | ||
(70, "Saving string failed"), | ||
(71, "String added in the repository"), | ||
(72, "String updated in the upload"), | ||
(73, "String added in the upload"), | ||
(74, "Translation updated by source upload"), | ||
(75, "Component translation completed"), | ||
], | ||
default=2, | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters