Skip to content

Commit

Permalink
fix: do not show translation as completed when there are failing checks
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Jan 28, 2025
1 parent e845446 commit dd135b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions weblate/templates/snippets/list-objects.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
{% if project and project.enable_review %}
{% review_percent category.stats %}
{% endif %}
{% list_objects_percent percent=category.stats.translated_percent value=category.stats.translated search_url=search_url translate_url=translate_url query="q=state:>=translated" total=category.stats.all %}
{% list_objects_percent percent=category.stats.translated_percent value=category.stats.translated search_url=search_url translate_url=translate_url query="q=state:>=translated" total=category.stats.all checks=category.stats.allchecks %}
{% if not hide_details %}
{% list_objects_number value=category.stats.todo search_url=search_url translate_url=translate_url query="q=state:<translated " css="zero-width-640" %} {% list_objects_number value=category.stats.todo_words search_url=search_url translate_url=translate_url query="q=state:<translated" css="zero-width-720" %} {% list_objects_number value=category.stats.todo_chars search_url=search_url translate_url=translate_url query="q=state:<translated" css="zero-width-1200" %} {% list_objects_number value=category.stats.nottranslated search_url=search_url translate_url=translate_url query="q=state:empty" css="zero-width-1400" %} {% list_objects_number value=category.stats.allchecks search_url=search_url translate_url=translate_url query="q=has:check" css="zero-width-768" %} {% list_objects_number value=category.stats.suggestions search_url=search_url translate_url=translate_url query="q=has:suggestion#suggestions" css="zero-width-900" %} {% list_objects_number value=category.stats.comments search_url=search_url translate_url=translate_url query="q=has:comment#comments" css="zero-width-1000" %}
{% endif %}
Expand Down Expand Up @@ -261,7 +261,7 @@
{% if is_glossary %}
{% list_objects_number value=object.stats.translated search_url=search_url translate_url=translate_url query="q=state:>=translated" show_zero=True %}
{% else %}
{% list_objects_percent percent=object.stats.translated_percent value=object.stats.translated search_url=search_url translate_url=translate_url query="q=state:>=translated" total=object.stats.all %}
{% list_objects_percent percent=object.stats.translated_percent value=object.stats.translated search_url=search_url translate_url=translate_url query="q=state:>=translated" total=object.stats.all checks=object.stats.allchecks %}
{% endif %}
{% if not hide_details %}
{% list_objects_number value=object.stats.todo search_url=search_url translate_url=translate_url query="q=state:<translated" css="zero-width-640" %}
Expand Down
4 changes: 3 additions & 1 deletion weblate/trans/templatetags/translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ def review_percent(obj):
percent=stats.approved_percent + stats.readonly_percent,
query="q=state:>=approved",
total=stats.all,
checks=stats.allchecks,
css="zero-width-540",
)

Expand Down Expand Up @@ -1490,6 +1491,7 @@ def list_objects_percent(
percent: float,
value: int,
total: int,
checks: int,
search_url: str | None = None,
translate_url: str | None = None,
query: str = "",
Expand All @@ -1507,7 +1509,7 @@ def list_objects_percent(
else:
url_start = url_end = ""

if value and value == total:
if value and value == total and checks == 0:
percent_formatted = format_html(
"""<span class="green" title="{}">{}</span>""",
ngettext(
Expand Down

0 comments on commit dd135b9

Please sign in to comment.