Skip to content

formats: Treat converted PO files nearly as bilingual - #7585

Merged
nijel merged 2 commits into
WeblateOrg:mainfrom
nijel:convert-context
May 17, 2022
Merged

nijel merged 2 commits into
WeblateOrg:mainfrom
nijel:convert-context

Conversation

@nijel

@nijel nijel commented May 3, 2022 •

Copy link
Copy Markdown
Member

Proposed changes

Converting location to context is wrong because it is not guaranteed to
be unique. Actually, all conversion engines merge same strings into
single unit.

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.

TODO:

  • Add migrations for existing units (adjust id_hash, move context to location)

Other information

@nijel nijel added this to the 4.13 milestone May 3, 2022
@nijel nijel self-assigned this May 3, 2022
@nijel
nijel force-pushed the convert-context branch from 10a545c to 7a6c198 Compare May 4, 2022 10:53
@nijel
nijel force-pushed the convert-context branch 5 times, most recently from 580a25c to eff73f1 Compare May 12, 2022 13:43
@codecov

codecov Bot commented May 12, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #7585 (c0e9c3c) into main (019c333) will increase coverage by 0.44%.
The diff coverage is n/a.

❗ Current head c0e9c3c differs from pull request most recent head 0caeaf3. Consider uploading reports for the commit 0caeaf3 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7585      +/-   ##
==========================================
+ Coverage   90.58%   91.02%   +0.44%     
==========================================
  Files         658      658              
  Lines       48438    49463    +1025     
  Branches     7104     7618     +514     
==========================================
+ Hits        43876    45023    +1147     
+ Misses       3166     3072      -94     
+ Partials     1396     1368      -28     
Impacted Files Coverage Δ
weblate/api/tests.py 100.00% <0.00%> (ø)
weblate/lang/forms.py 100.00% <0.00%> (ø)
weblate/checks/data.py 100.00% <0.00%> (ø)
weblate/legal/tests.py 100.00% <0.00%> (ø)
weblate/checks/tasks.py 100.00% <0.00%> (ø)
weblate/utils/models.py 100.00% <0.00%> (ø)
weblate/billing/tests.py 100.00% <0.00%> (ø)
weblate/wladmin/tests.py 100.00% <0.00%> (ø)
weblate/api/throttling.py 100.00% <0.00%> (ø)
weblate/utils/decorators.py 100.00% <0.00%> (ø)
... and 171 more

@nijel
nijel force-pushed the convert-context branch from eff73f1 to 8e399d9 Compare May 17, 2022 08:18
- Converting location to context is wrong because it is not guaranteed to be unique.
- Actually, all conversion engines merge same strings into single unit.
- Rewrite format indexes to use id_hash for consistency and better performance.
- Fixes WeblateOrg#7024 (line offsetting in context)
@nijel
nijel force-pushed the convert-context branch from 8e399d9 to 2a08334 Compare May 17, 2022 08:21
@nijel
nijel marked this pull request as ready for review May 17, 2022 08:26
@nijel
nijel merged commit 18793dc into WeblateOrg:main May 17, 2022
@nijel
nijel deleted the convert-context branch May 17, 2022 13:05
@nijel nijel mentioned this pull request Jun 6, 2022
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.

1 participant