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

refactor(cli/catalog): decouple catalog type from Po message shape #1549

Merged

Conversation

timofei-iatsenko
Copy link
Collaborator

@timofei-iatsenko timofei-iatsenko commented Mar 22, 2023

Description

While working on a new xliff formatter realized that current shape of CatalogType and ExtractedMessage are tightly coupled to shape of the message of Pofile. There some properties which is related to po formatter only and should not be in the core type.

The same with other formatters. For example xliff may have additional attributes such as state=final which we also should store somewhere to not lost when extracting. So there should be a way to add some extra fields which would be preserved by cli and returned back to formatter.

In scheme it something like

formatter.parse -> extra: {special field} -> cli catalog processing -> formatter.serialize (get the same extra: {special field})

Notes:

i renamed extractedComments -> comments. this naming was because Pofile has it. When it's uncoupled, we don't
need it anymore and just comments looks much cleaner in the api.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Fixes # (issue)

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Mar 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
js-lingui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 22, 2023 at 11:17AM (UTC)

@github-actions
Copy link

github-actions bot commented Mar 22, 2023

size-limit report 📦

Path Size
./packages/core/build/esm/index.js 1.61 KB (0%)
./packages/detect-locale/build/esm/index.js 812 B (0%)
./packages/react/build/esm/index.js 1.59 KB (0%)
./packages/remote-loader/build/esm/index.js 7.25 KB (0%)

@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Patch coverage: 80.00% and no project coverage change.

Comparison is base (94a7e3c) 75.34% compared to head (3e2f749) 75.34%.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #1549   +/-   ##
=======================================
  Coverage   75.34%   75.34%           
=======================================
  Files          78       78           
  Lines        1971     1971           
  Branches      516      516           
=======================================
  Hits         1485     1485           
  Misses        375      375           
  Partials      111      111           
Impacted Files Coverage Δ
packages/format-po/src/po.ts 93.44% <77.77%> (ø)
packages/cli/src/api/catalog/extractFromFiles.ts 93.75% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@andrii-bodnar andrii-bodnar merged commit 2cb5175 into lingui:next Mar 22, 2023
@andrii-bodnar
Copy link
Contributor

@timofei-iatsenko timofei-iatsenko deleted the decouple-catalog-type-from-po branch March 22, 2023 12: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.

2 participants