Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'Rescan' not enforcing rescan of source translation files. #11687

Merged
merged 1 commit into from
May 22, 2024

Conversation

mont29
Copy link
Contributor

@mont29 mont29 commented May 22, 2024

Proposed changes

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.).

Checklist

  • Lint and unit tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added documentation to describe my feature.
  • I have squashed my commits into logic units.
  • I have described the changes in the commit messages.

Other information

Found out this unexpected behavior while investigating 'missed updates' issues for some of our translations at translate.blender.org

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.).
@nijel nijel self-assigned this May 22, 2024
@nijel nijel added this to the 5.6 milestone May 22, 2024
Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.52%. Comparing base (6aee586) to head (967e8d3).
Report is 1847 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11687      +/-   ##
==========================================
- Coverage   90.82%   90.52%   -0.30%     
==========================================
  Files         554      572      +18     
  Lines       57306    58664    +1358     
  Branches     9122     9371     +249     
==========================================
+ Hits        52046    53104    +1058     
- Misses       3640     3853     +213     
- Partials     1620     1707      +87     
Files Coverage Δ
weblate/trans/models/component.py 79.47% <100.00%> (-0.48%) ⬇️

... and 255 files with indirect coverage changes

@nijel nijel merged commit afd7f75 into WeblateOrg:main May 22, 2024
31 of 32 checks passed
@nijel
Copy link
Member

nijel commented May 22, 2024

Merged, thanks for your contribution!

@mont29
Copy link
Contributor Author

mont29 commented May 22, 2024

Thanks for the fast handling! :D

@mont29 mont29 deleted the tmp-file-rescan-force branch May 26, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants