refactor(cli/catalog): decouple catalog type from Po message shape #1549
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 someextra
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
Fixes # (issue)
Checklist