From aa9a75a72044cc1af3e2660744e23673fde090f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 10 Oct 2023 12:53:57 +0200 Subject: [PATCH] changes: consolidate action names Consistently use noun + verb past. Fixes #9824 --- .../migrations/0007_alter_change_action.py | 90 +++++++++++++++++++ weblate/trans/models/change.py | 82 ++++++++--------- weblate/trans/tests/test_changes.py | 4 +- 3 files changed, 133 insertions(+), 43 deletions(-) create mode 100644 weblate/trans/migrations/0007_alter_change_action.py diff --git a/weblate/trans/migrations/0007_alter_change_action.py b/weblate/trans/migrations/0007_alter_change_action.py new file mode 100644 index 000000000000..3b8ac5c4862c --- /dev/null +++ b/weblate/trans/migrations/0007_alter_change_action.py @@ -0,0 +1,90 @@ +# Copyright © Michal Čihař +# +# SPDX-License-Identifier: GPL-3.0-or-later + +# Generated by Django 4.2.6 on 2023-10-12 12:56 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("trans", "0006_alter_change_action"), + ] + + 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, "Screnshot added"), + (58, "Screnshot 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"), + ], + default=2, + ), + ), + ] diff --git a/weblate/trans/models/change.py b/weblate/trans/models/change.py index 877c022288f4..5edf5301a5a2 100644 --- a/weblate/trans/models/change.py +++ b/weblate/trans/models/change.py @@ -289,19 +289,19 @@ class Change(models.Model, UserDisplayMixin): ACTION_CHOICES = ( # Translators: Name of event in the history - (ACTION_UPDATE, gettext_lazy("Resource update")), + (ACTION_UPDATE, gettext_lazy("Resource updated")), # Translators: Name of event in the history (ACTION_COMPLETE, gettext_lazy("Translation completed")), # Translators: Name of event in the history (ACTION_CHANGE, gettext_lazy("Translation changed")), # Translators: Name of event in the history - (ACTION_NEW, gettext_lazy("New translation")), + (ACTION_NEW, gettext_lazy("Translation added")), # Translators: Name of event in the history (ACTION_COMMENT, gettext_lazy("Comment added")), # Translators: Name of event in the history (ACTION_SUGGESTION, gettext_lazy("Suggestion added")), # Translators: Name of event in the history - (ACTION_AUTO, gettext_lazy("Automatic translation")), + (ACTION_AUTO, gettext_lazy("Automatically translated")), # Translators: Name of event in the history (ACTION_ACCEPT, gettext_lazy("Suggestion accepted")), # Translators: Name of event in the history @@ -309,83 +309,83 @@ class Change(models.Model, UserDisplayMixin): # Translators: Name of event in the history (ACTION_UPLOAD, gettext_lazy("Translation uploaded")), # Translators: Name of event in the history - (ACTION_NEW_SOURCE, gettext_lazy("New source string")), + (ACTION_NEW_SOURCE, gettext_lazy("Source string added")), # Translators: Name of event in the history (ACTION_LOCK, gettext_lazy("Component locked")), # Translators: Name of event in the history (ACTION_UNLOCK, gettext_lazy("Component unlocked")), # Translators: Name of event in the history - (ACTION_COMMIT, gettext_lazy("Committed changes")), + (ACTION_COMMIT, gettext_lazy("Changes committed")), # Translators: Name of event in the history - (ACTION_PUSH, gettext_lazy("Pushed changes")), + (ACTION_PUSH, gettext_lazy("Changes pushed")), # Translators: Name of event in the history - (ACTION_RESET, gettext_lazy("Reset repository")), + (ACTION_RESET, gettext_lazy("Repository reset")), # Translators: Name of event in the history - (ACTION_MERGE, gettext_lazy("Merged repository")), + (ACTION_MERGE, gettext_lazy("Repository merged")), # Translators: Name of event in the history - (ACTION_REBASE, gettext_lazy("Rebased repository")), + (ACTION_REBASE, gettext_lazy("Repository rebased")), # Translators: Name of event in the history - (ACTION_FAILED_MERGE, gettext_lazy("Failed merge on repository")), + (ACTION_FAILED_MERGE, gettext_lazy("Repository merge failed")), # Translators: Name of event in the history - (ACTION_FAILED_REBASE, gettext_lazy("Failed rebase on repository")), + (ACTION_FAILED_REBASE, gettext_lazy("Repository rebase failed")), # Translators: Name of event in the history - (ACTION_FAILED_PUSH, gettext_lazy("Failed push on repository")), + (ACTION_FAILED_PUSH, gettext_lazy("Repository push failed")), # Translators: Name of event in the history - (ACTION_PARSE_ERROR, gettext_lazy("Parse error")), + (ACTION_PARSE_ERROR, gettext_lazy("Parsing failed")), # Translators: Name of event in the history - (ACTION_REMOVE_TRANSLATION, gettext_lazy("Removed translation")), + (ACTION_REMOVE_TRANSLATION, gettext_lazy("Translation removed")), # Translators: Name of event in the history (ACTION_SUGGESTION_DELETE, gettext_lazy("Suggestion removed")), # Translators: Name of event in the history - (ACTION_REPLACE, gettext_lazy("Search and replace")), + (ACTION_REPLACE, gettext_lazy("Translation replaced")), # Translators: Name of event in the history (ACTION_SUGGESTION_CLEANUP, gettext_lazy("Suggestion removed during cleanup")), # Translators: Name of event in the history (ACTION_SOURCE_CHANGE, gettext_lazy("Source string changed")), # Translators: Name of event in the history - (ACTION_NEW_UNIT, gettext_lazy("New string added")), + (ACTION_NEW_UNIT, gettext_lazy("String added")), # Translators: Name of event in the history - (ACTION_BULK_EDIT, gettext_lazy("Bulk status change")), + (ACTION_BULK_EDIT, gettext_lazy("Bulk status changed")), # Translators: Name of event in the history - (ACTION_ACCESS_EDIT, gettext_lazy("Changed visibility")), + (ACTION_ACCESS_EDIT, gettext_lazy("Visibility changed")), # Translators: Name of event in the history - (ACTION_ADD_USER, gettext_lazy("Added user")), + (ACTION_ADD_USER, gettext_lazy("User added")), # Translators: Name of event in the history - (ACTION_REMOVE_USER, gettext_lazy("Removed user")), + (ACTION_REMOVE_USER, gettext_lazy("User removed")), # Translators: Name of event in the history (ACTION_APPROVE, gettext_lazy("Translation approved")), # Translators: Name of event in the history (ACTION_MARKED_EDIT, gettext_lazy("Marked for edit")), # Translators: Name of event in the history - (ACTION_REMOVE_COMPONENT, gettext_lazy("Removed component")), + (ACTION_REMOVE_COMPONENT, gettext_lazy("Component removed")), # Translators: Name of event in the history - (ACTION_REMOVE_PROJECT, gettext_lazy("Removed project")), + (ACTION_REMOVE_PROJECT, gettext_lazy("Project removed")), # Translators: Name of event in the history - (ACTION_RENAME_PROJECT, gettext_lazy("Renamed project")), + (ACTION_RENAME_PROJECT, gettext_lazy("Project renamed")), # Translators: Name of event in the history - (ACTION_RENAME_COMPONENT, gettext_lazy("Renamed component")), + (ACTION_RENAME_COMPONENT, gettext_lazy("Component renamed")), # Translators: Name of event in the history (ACTION_MOVE_COMPONENT, gettext_lazy("Moved component")), # Translators: Name of event in the history - (ACTION_NEW_CONTRIBUTOR, gettext_lazy("New contributor")), + (ACTION_NEW_CONTRIBUTOR, gettext_lazy("Contributor joined")), # Translators: Name of event in the history - (ACTION_ANNOUNCEMENT, gettext_lazy("New announcement")), + (ACTION_ANNOUNCEMENT, gettext_lazy("Announcement posted")), # Translators: Name of event in the history - (ACTION_ALERT, gettext_lazy("New alert")), + (ACTION_ALERT, gettext_lazy("Alert triggered")), # Translators: Name of event in the history - (ACTION_ADDED_LANGUAGE, gettext_lazy("Added new language")), + (ACTION_ADDED_LANGUAGE, gettext_lazy("Language added")), # Translators: Name of event in the history - (ACTION_REQUESTED_LANGUAGE, gettext_lazy("Requested new language")), + (ACTION_REQUESTED_LANGUAGE, gettext_lazy("Language requested")), # Translators: Name of event in the history - (ACTION_CREATE_PROJECT, gettext_lazy("Created project")), + (ACTION_CREATE_PROJECT, gettext_lazy("Project created")), # Translators: Name of event in the history - (ACTION_CREATE_COMPONENT, gettext_lazy("Created component")), + (ACTION_CREATE_COMPONENT, gettext_lazy("Component created")), # Translators: Name of event in the history - (ACTION_INVITE_USER, gettext_lazy("Invited user")), + (ACTION_INVITE_USER, gettext_lazy("User invited")), # Translators: Name of event in the history - (ACTION_HOOK, gettext_lazy("Received repository notification")), + (ACTION_HOOK, gettext_lazy("Repository notification received")), # Translators: Name of event in the history - (ACTION_REPLACE_UPLOAD, gettext_lazy("Replaced file by upload")), + (ACTION_REPLACE_UPLOAD, gettext_lazy("Translation replaced file by upload")), # Translators: Name of event in the history (ACTION_LICENSE_CHANGE, gettext_lazy("License changed")), # Translators: Name of event in the history @@ -403,24 +403,24 @@ class Change(models.Model, UserDisplayMixin): # Translators: Name of event in the history (ACTION_ADDON_REMOVE, gettext_lazy("Add-on uninstalled")), # Translators: Name of event in the history - (ACTION_STRING_REMOVE, gettext_lazy("Removed string")), + (ACTION_STRING_REMOVE, gettext_lazy("String removed")), # Translators: Name of event in the history - (ACTION_COMMENT_DELETE, gettext_lazy("Removed comment")), + (ACTION_COMMENT_DELETE, gettext_lazy("Comment removed")), # Translators: Name of event in the history ( ACTION_COMMENT_RESOLVE, - pgettext_lazy("Name of event in the history", "Resolved comment"), + pgettext_lazy("Name of event in the history", "Comment resolved"), ), # Translators: Name of event in the history (ACTION_EXPLANATION, gettext_lazy("Explanation updated")), # Translators: Name of event in the history - (ACTION_REMOVE_CATEGORY, gettext_lazy("Removed category")), + (ACTION_REMOVE_CATEGORY, gettext_lazy("Category removed")), # Translators: Name of event in the history - (ACTION_RENAME_CATEGORY, gettext_lazy("Renamed category")), + (ACTION_RENAME_CATEGORY, gettext_lazy("Category renamed")), # Translators: Name of event in the history - (ACTION_MOVE_CATEGORY, gettext_lazy("Moved category")), + (ACTION_MOVE_CATEGORY, gettext_lazy("Category moved")), # Translators: Name of event in the history - (ACTION_SAVE_FAILED, gettext_lazy("Could not save string")), + (ACTION_SAVE_FAILED, gettext_lazy("Saving string failed")), ) ACTIONS_DICT = dict(ACTION_CHOICES) ACTION_STRINGS = { diff --git a/weblate/trans/tests/test_changes.py b/weblate/trans/tests/test_changes.py index e8373612fe6f..57f2d1d4a502 100644 --- a/weblate/trans/tests/test_changes.py +++ b/weblate/trans/tests/test_changes.py @@ -49,11 +49,11 @@ def test_string(self): response = self.client.get( reverse("changes", kwargs={"path": Unit.objects.first().get_url_path()}) ) - self.assertContains(response, "New source string") + self.assertContains(response, "Source string added") self.assertContains(response, "Changes of string in") def test_user(self): self.edit_unit("Hello, world!\n", "Nazdar svete!\n") response = self.client.get(reverse("changes"), {"user": self.user.username}) - self.assertContains(response, "New translation") + self.assertContains(response, "Translation added") self.assertNotContains(response, "Invalid search string!")