Skip to content

Commit

Permalink
fix(component): 'Rescan' not enforcing rescan of source translation f…
Browse files Browse the repository at this point in the history
…iles. (#11687)

Set the `force` option to `True` when calling `create_translations` in
the `do_file_scan` handler, as already done by the `do_reset` one.

Currently, 'Reset' will (after resetting the weblate repository),
enforce a complete rescan of all source translation files (e.g. all PO
files).

The 'Rescan' option however, does not. As a consequence, translations
sources are only re-scanned in case the source files are actually
detected as changed since last update.

This behavior does not seem consistent with the description of this
command (`Loads translations from the files into Weblate. Use when
Weblate missed some of the strings after updating the repository`).

And it does not indeed actually update translations when e.g. the regular
'Update' command failed to finish properly (due to reaching the request
timeout delay of the WSGI server e.g.).

Co-authored-by: Bastien Montagne <bastien@blender.org>
  • Loading branch information
mont29 and Bastien Montagne committed May 22, 2024
1 parent b7a99d2 commit afd7f75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weblate/trans/models/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,7 @@ def do_file_sync(self, request=None):
def do_file_scan(self, request=None):
self.commit_pending("file-scan", request.user if request else None)
try:
return self.create_translations(request=request)
return self.create_translations(request=request, force=True)
except FileParseError:
return False

Expand Down

0 comments on commit afd7f75

Please sign in to comment.