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(machinery): avoid mixing translations with different replacements #11891

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

nijel
Copy link
Member

@nijel nijel commented Jun 18, 2024

Proposed changes

The same text and different replacements would use first replacements only because the text is replaced in the translations dictionary.

Fixes #11179

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

@nijel nijel added this to the 5.6 milestone Jun 18, 2024
@nijel nijel self-assigned this Jun 18, 2024
@nijel nijel enabled auto-merge (rebase) June 18, 2024 13:31
The same text and different replacements would use first replacements
only because the text is replaced in the translations dictionary.

Fixes WeblateOrg#11179
Copy link

codecov bot commented Jun 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.59%. Comparing base (6aee586) to head (aa4a3d6).
Report is 2208 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11891      +/-   ##
==========================================
- Coverage   90.82%   90.59%   -0.23%     
==========================================
  Files         554      576      +22     
  Lines       57306    58785    +1479     
  Branches     9122     9385     +263     
==========================================
+ Hits        52046    53259    +1213     
- Misses       3640     3831     +191     
- Partials     1620     1695      +75     
Files Coverage Δ
weblate/machinery/base.py 90.95% <100.00%> (-0.08%) ⬇️
weblate/machinery/tests.py 99.85% <100.00%> (+<0.01%) ⬆️

... and 326 files with indirect coverage changes

@nijel nijel merged commit d53bce1 into WeblateOrg:main Jun 18, 2024
30 of 31 checks passed
@nijel nijel deleted the machine-replacements branch June 18, 2024 15:51
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.

Wrong Translation using Xliff with placeholder support
1 participant