Skip to content

Commit

Permalink
changes: consolidate action names
Browse files Browse the repository at this point in the history
Consistently use noun + verb past.

Fixes WeblateOrg#9824
  • Loading branch information
nijel committed Oct 12, 2023
1 parent 8a9a667 commit aa9a75a
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 43 deletions.
90 changes: 90 additions & 0 deletions weblate/trans/migrations/0007_alter_change_action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright © Michal Čihař <[email protected]>
#
# 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,
),
),
]
82 changes: 41 additions & 41 deletions weblate/trans/models/change.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,103 +289,103 @@ 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
(ACTION_REVERT, gettext_lazy("Translation reverted")),
# 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
Expand All @@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions weblate/trans/tests/test_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!")

0 comments on commit aa9a75a

Please sign in to comment.