feat(xliff): add MF1 format and PGS support for export/import - #20
Merged
Conversation
Pull in format-aware msg 0.8.1 plus @messageformat/icu-messageformat-1 and parser for MF1↔PGS conversion. Refs #15. Co-authored-by: Cursor <cursoragent@cursor.com>
Encode/decode MsgFormat via XLIFF unit type (msg:NONE|MF1|MF2) and resolve inherited format. Refs #15. Co-authored-by: Cursor <cursoragent@cursor.com>
Add mf1MessageToPgsExport / pgsImportToMf1Message stubs that return null so TDD tests fail until Phase 4. Refs #15. Co-authored-by: Cursor <cursoragent@cursor.com>
Persist resolved format on unit@type, route MF1 through PGS stubs, and tolerate messageformat options as Map or plain object for ordinals. Refs #15. Co-authored-by: Cursor <cursoragent@cursor.com>
Convert via mf1ToMessageData into shared PGS export; reconstruct nested ICU on import, mapping plural vars to #. Refs #15. Co-authored-by: Cursor <cursoragent@cursor.com>
Emit ICU #/{name} segment text on MF1 export, reuse MsgFormat from
@worldware/msg, clarify resolveMessageFormat args, and DRY import
segment joins. Refs #15.
Co-authored-by: Cursor <cursoragent@cursor.com>
Cover helper round-trips and import-command e2e for NONE/MF1/MF2 plus MF1 plural PGS, and edge cases for malformed MF1. Refs #15. Co-authored-by: Cursor <cursoragent@cursor.com>
Update README, export/import specs, and project info for unit@type (msg:*) and MF1 ICU ↔ PGS support. Refs #15. Co-authored-by: Cursor <cursoragent@cursor.com>
Extract pgsExportForFormat, simplify segment text join, and export SelectMessage for docs/typing consistency. Refs #15. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
@worldware/msgto^0.8.1and add MF1 tooling deps (@messageformat/icu-messageformat-1,@messageformat/parser).format(NONE/MF1/MF2) on XLIFF 2.2unit@typeasmsg:*during export/import.plural/selectordinal/select↔ XLIFF PGS conversion (pgs-mf1.ts), with MF1-friendly segment bodies (#/{name})..match↔ PGS path (pgs-mf2.ts).Closes #15
Test plan
npm test— 288 tests greennpx tsc --noEmitandnpm run buildpasstype="msg:MF1"(etc.); import restoresattributes.format