diff --git a/docs/api.rst b/docs/api.rst index ec3f3107306a..beae3b753b66 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -2151,7 +2151,7 @@ and XLIFF. The ``target`` and ``source`` are now arrays to properly handle plural strings. - Returns information about translation unit. + Returns information about the translation unit. :param id: Unit ID :type id: int @@ -2166,7 +2166,7 @@ and XLIFF. :>json string note: translation unit note :>json string flags: translation unit flags :>json array labels: translation unit labels, available on source units - :>json int state: unit state, 0 - untranslated, 10 - needs editing, 20 - translated, 30 - approved, 100 - read only + :>json int state: unit state, 0 - untranslated, 10 - needs editing, 20 - translated, 30 - approved, 100 - read-only :>json boolean fuzzy: whether the unit is fuzzy or marked for review :>json boolean translated: whether the unit is translated :>json boolean approved: whether the translation is approved diff --git a/weblate/auth/permissions.py b/weblate/auth/permissions.py index efa7b924bf2c..56c16f6a3048 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 @@ -189,7 +189,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." ) ) @@ -197,7 +197,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.") @@ -224,7 +224,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." ) ) @@ -243,8 +243,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 @@ -256,7 +256,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) @@ -266,12 +266,12 @@ def check_edit_approved(user: User, permission: str, obj: Model): if isinstance(obj, Unit): unit = obj obj = unit.translation - # Read only check is unconditional as there is another one + # Read-only check is unconditional as there is another one # in PluralTextarea.render if unit.readonly: if not unit.source_unit.translated: return Denied(gettext("The source string needs review.")) - return Denied(gettext("The string is read only.")) + return Denied(gettext("The string is read-only.")) # Ignore approved state if review is not disabled. This might # happen after disabling them. if ( @@ -281,13 +281,13 @@ 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): component = obj.component if obj.is_readonly: - return Denied(gettext("The translation is read only.")) + return Denied(gettext("The translation is read-only.")) elif isinstance(obj, Component): component = obj if component is not None and component.is_glossary: @@ -323,7 +323,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 @@ -335,7 +335,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" @@ -352,7 +352,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" diff --git a/weblate/checks/flags.py b/weblate/checks/flags.py index deb45e8618c2..f34232acff2b 100644 --- a/weblate/checks/flags.py +++ b/weblate/checks/flags.py @@ -46,7 +46,7 @@ PLAIN_FLAGS["auto-java-messageformat"] = gettext_lazy( "Automatically detect Java MessageFormat" ) -PLAIN_FLAGS["read-only"] = gettext_lazy("Read only") +PLAIN_FLAGS["read-only"] = gettext_lazy("Read-only") PLAIN_FLAGS["strict-same"] = gettext_lazy("Strict unchanged check") PLAIN_FLAGS["strict-format"] = gettext_lazy("Strict format string checks") PLAIN_FLAGS["forbidden"] = gettext_lazy("Forbidden translation") diff --git a/weblate/templates/snippets/unit-readonly-badge.html b/weblate/templates/snippets/unit-readonly-badge.html index 4d15683050bc..96296b0da5f8 100644 --- a/weblate/templates/snippets/unit-readonly-badge.html +++ b/weblate/templates/snippets/unit-readonly-badge.html @@ -9,6 +9,6 @@ {% elif unit.is_source %} {% trans "Source string" %} {% else %} - {% trans "Read only" %} + {% trans "Read-only" %} {% endif %} {% endif %} diff --git a/weblate/templates/translate.html b/weblate/templates/translate.html index f0a5a5af3aad..1f172f990828 100644 --- a/weblate/templates/translate.html +++ b/weblate/templates/translate.html @@ -230,7 +230,7 @@

{% elif project_locked %} title="{% trans "This translation is currently locked." %}" {% elif unit.readonly %} - title="{% trans "Read only" %}" + title="{% trans "Read-only" %}" {% endif %} >{% icon "suggest.svg" %} {% trans "Suggest" %} {% endif %} diff --git a/weblate/utils/state.py b/weblate/utils/state.py index 450b5f72ab8a..0675652859d9 100644 --- a/weblate/utils/state.py +++ b/weblate/utils/state.py @@ -18,7 +18,7 @@ class StringState(IntegerChoices): STATE_FUZZY = 10, pgettext_lazy("String state", "Needs editing") STATE_TRANSLATED = 20, pgettext_lazy("String state", "Translated") STATE_APPROVED = 30, pgettext_lazy("String state", "Approved") - STATE_READONLY = 100, pgettext_lazy("String state", "Read only") + STATE_READONLY = 100, pgettext_lazy("String state", "Read-only") STATE_EMPTY = StringState.STATE_EMPTY