WeblateOrg / weblate

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

fix(formats): avoid using internal unit in add_unit() #11847

Closed nijel closed 2 weeks ago

nijel commented 2 weeks ago

Proposed changes

This breaks in multivalue storage and is using internals where not necessary.

Fixes WEBLATE-CH

Checklist

Other information

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 85.71429% with 4 lines in your changes missing coverage. Please review.

Project coverage is 90.57%. Comparing base (6aee586) to head (77b4f94). Report is 2135 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11847/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/11847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg) ```diff @@ Coverage Diff @@ ## main #11847 +/- ## ========================================== - Coverage 90.82% 90.57% -0.25% ========================================== Files 554 576 +22 Lines 57306 58707 +1401 Branches 9122 9386 +264 ========================================== + Hits 52046 53173 +1127 - Misses 3640 3835 +195 - Partials 1620 1699 +79 ``` | [Files](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11847?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg) | Coverage Δ | | |---|---|---| | [weblate/formats/base.py](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11847?src=pr&el=tree&filepath=weblate%2Fformats%2Fbase.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg#diff-d2VibGF0ZS9mb3JtYXRzL2Jhc2UucHk=) | `89.86% <100.00%> (+0.08%)` | :arrow_up: | | [weblate/formats/tests/test\_formats.py](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11847?src=pr&el=tree&filepath=weblate%2Fformats%2Ftests%2Ftest_formats.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg#diff-d2VibGF0ZS9mb3JtYXRzL3Rlc3RzL3Rlc3RfZm9ybWF0cy5weQ==) | `99.76% <100.00%> (+<0.01%)` | :arrow_up: | | [weblate/formats/ttkit.py](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11847?src=pr&el=tree&filepath=weblate%2Fformats%2Fttkit.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg#diff-d2VibGF0ZS9mb3JtYXRzL3R0a2l0LnB5) | `90.84% <100.00%> (-0.57%)` | :arrow_down: | | [weblate/formats/txt.py](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11847?src=pr&el=tree&filepath=weblate%2Fformats%2Ftxt.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg#diff-d2VibGF0ZS9mb3JtYXRzL3R4dC5weQ==) | `79.87% <100.00%> (-0.52%)` | :arrow_down: | | [weblate/trans/models/translation.py](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11847?src=pr&el=tree&filepath=weblate%2Ftrans%2Fmodels%2Ftranslation.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg#diff-d2VibGF0ZS90cmFucy9tb2RlbHMvdHJhbnNsYXRpb24ucHk=) | `86.71% <100.00%> (-0.50%)` | :arrow_down: | | [weblate/formats/convert.py](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11847?src=pr&el=tree&filepath=weblate%2Fformats%2Fconvert.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg#diff-d2VibGF0ZS9mb3JtYXRzL2NvbnZlcnQucHk=) | `87.64% <50.00%> (-1.22%)` | :arrow_down: | | [weblate/formats/multi.py](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11847?src=pr&el=tree&filepath=weblate%2Fformats%2Fmulti.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg#diff-d2VibGF0ZS9mb3JtYXRzL211bHRpLnB5) | `83.62% <40.00%> (-3.88%)` | :arrow_down: | ... and [316 files with indirect coverage changes](https://app.codecov.io/gh/WeblateOrg/weblate/pull/11847/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=WeblateOrg)