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

formats: Treat converted PO files nearly as bilingual #7585

Merged
merged 2 commits into from
May 17, 2022

Conversation

nijel
Copy link
Member

@nijel nijel commented May 3, 2022

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 5 times, most recently from 580a25c to eff73f1 Compare May 12, 2022 13:43
@codecov
Copy link

codecov bot commented May 12, 2022

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

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