WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.52k stars 998 forks source link

fix(machinery): avoid mixing translations with different replacements #11891

Closed nijel closed 3 months ago

nijel commented 3 months ago

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

Other information

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11891/graphs/tree.svg?width=650&height=150&src=pr&token=9rzx9QBq35&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg)](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11891?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg) ```diff @@ 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 with missing lines](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11891?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg) | Coverage Δ | | |---|---|---| | [weblate/machinery/base.py](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11891?src=pr&el=tree&filepath=weblate%2Fmachinery%2Fbase.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg#diff-d2VibGF0ZS9tYWNoaW5lcnkvYmFzZS5weQ==) | `90.95% <100.00%> (-0.08%)` | :arrow_down: | | [weblate/machinery/tests.py](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11891?src=pr&el=tree&filepath=weblate%2Fmachinery%2Ftests.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg#diff-d2VibGF0ZS9tYWNoaW5lcnkvdGVzdHMucHk=) | `99.85% <100.00%> (+<0.01%)` | :arrow_up: | ... and [326 files with indirect coverage changes](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11891/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg)