Skip to content

Commit

Permalink
checks: avoid reused check to trigger on blank strings
Browse files Browse the repository at this point in the history
Fixes #9805
  • Loading branch information
nijel committed Aug 25, 2023
1 parent 2457899 commit f3ee140
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Not yet released.
* Creating component within a category.
* Source strings and state display for converted formats.
* Block :ref:`component-edit_template` on formats which do not support it.
* :ref:`check-reused` is no longer triggered for blank strings.

**Compatibility**

Expand Down
3 changes: 2 additions & 1 deletion weblate/checks/consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def get_propagated_units(self, unit, target: str | None = None):
return Unit.objects.same_target(unit, target)

def should_skip(self, unit):
if unit.translation.plural.number <= 1:
if unit.translation.plural.number <= 1 or not any(unit.get_target_plurals()):
return True
return super().should_skip(unit)

Expand Down Expand Up @@ -201,6 +201,7 @@ def check_component(self, component):
translation__component__allow_translation_propagation=True,
state__gte=STATE_TRANSLATED,
)
units = units.exclude(target="")

# List strings with different sources
# Limit this to 100 strings, otherwise the resulting query is way too complex
Expand Down

0 comments on commit f3ee140

Please sign in to comment.