From fbd2efe9ebb3ad5766722d007935a24ce169ac01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Mon, 9 Sep 2024 10:17:50 +0000 Subject: [PATCH] fix: Permissions language reworked --- weblate/auth/permissions.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/weblate/auth/permissions.py b/weblate/auth/permissions.py index bc4adb67ba1a..85d01426abe0 100644 --- a/weblate/auth/permissions.py +++ b/weblate/auth/permissions.py @@ -58,7 +58,7 @@ def wrap_perm(function): def check_global_permission(user: User, permission: str) -> bool: - """Check whether user has a global permission.""" + """Check whether the user has a global permission.""" if user.is_superuser: return True return permission in user.global_permissions @@ -191,7 +191,7 @@ def check_can_edit(user: User, permission: str, obj: Model, is_vote=False): # n ): return Denied( gettext( - "Contributing to this translation requires agreeing to its contributor agreement." + "Contributing to this translation requires accepting its contributor license agreement." ) ) @@ -199,7 +199,7 @@ def check_can_edit(user: User, permission: str, obj: Model, is_vote=False): # n if not check_permission(user, permission, obj): if not user.is_authenticated: # Signing in might help, but user still might need additional privileges - return Denied(gettext("Sign in to save the translation.")) + return Denied(gettext("Sign in to save translations.")) if permission == "unit.review": return Denied( gettext("Insufficient privileges for approving translations.") @@ -226,7 +226,7 @@ def check_can_edit(user: User, permission: str, obj: Model, is_vote=False): # n ): return Denied( gettext( - "This translation only accepts suggestions, and these are approved by voting." + "This translation only accepts suggestions, in turn approved by voting." ) ) @@ -245,8 +245,8 @@ def check_unit_review(user: User, permission: str, obj: Model, skip_enabled=Fals if isinstance(obj, Translation): if not obj.enable_review: if obj.is_source: - return Denied(gettext("Source string reviews are not enabled.")) - return Denied(gettext("Translation reviews are not enabled.")) + return Denied(gettext("Source-string reviews are turned off.")) + return Denied(gettext("Translation reviews are turned off.")) else: if isinstance(obj, CategoryLanguage): project = obj.category.project @@ -258,7 +258,7 @@ def check_unit_review(user: User, permission: str, obj: Model, skip_enabled=Fals else: project = obj if not project.source_review and not project.translation_review: - return Denied(gettext("Reviews are not enabled.")) + return Denied(gettext("Reviewing is turned off.")) return check_can_edit(user, permission, obj) @@ -283,7 +283,7 @@ def check_edit_approved(user: User, permission: str, obj: Model): ): return Denied( gettext( - "Only reviewers can change approved strings, please add a suggestion if you think the string should be changed." + "Only reviewers can change approved strings. Please add a suggestion if you think the string should be changed." ) ) if isinstance(obj, Translation): @@ -325,7 +325,7 @@ def check_unit_delete(user: User, permission: str, obj: Model): ): return Denied( gettext( - "Cannot remove terminology translation, remove source string instead." + "Cannot remove terminology translation. Remove the source string instead." ) ) obj = obj.translation @@ -337,7 +337,7 @@ def check_unit_delete(user: User, permission: str, obj: Model): # Does file format support removing? if not component.file_format_cls.can_delete_unit: - return Denied(gettext("File format does not support this.")) + return Denied(gettext("The file format does not support this.")) if component.is_glossary: permission = "glossary.delete" @@ -354,7 +354,7 @@ def check_unit_add(user: User, permission, translation): # Does file format support adding? if not component.file_format_cls.can_add_unit: - return Denied(gettext("File format does not support this.")) + return Denied(gettext("The file format does not support this.")) if component.is_glossary: permission = "glossary.add"