Conversation
Extract MF2/NONE helpers to src/lib; stub MF1 for TDD. Add @messageformat/parser as a direct dependency. Refs #59. Co-authored-by: Cursor <cursoragent@cursor.com>
Dispatch pseudo-locale values via pseudoLocalize using each message's resolved format; cover MF1/NONE/mixed cases. Refs #59. Co-authored-by: Cursor <cursoragent@cursor.com>
Walk @messageformat/parser AST content tokens (skipping function arg styles) and replace spans in the original source so ICU structure is preserved. Refs #59. Co-authored-by: Cursor <cursoragent@cursor.com>
Propagate inFunctionParam through nested selects, rebuild via ascending cursor, and tighten format-dispatch assertions. Refs #59. Co-authored-by: Cursor <cursoragent@cursor.com>
Cover mixed-format pseudoLocale formatting end-to-end, MF1 no-content spans, and getTranslation() cloning. Refs #59. Co-authored-by: Cursor <cursoragent@cursor.com>
Update README, GETTING_STARTED, and getTranslation JSDoc for MF1/MF2/NONE pseudo-locale behavior. Refs #59. Co-authored-by: Cursor <cursoragent@cursor.com>
Build pseudo messages with map; make the MF1 AST walk exhaustively handle argument/octothorpe tokens. Refs #59. Co-authored-by: Cursor <cursoragent@cursor.com>
|
🎉 This PR is included in version 0.11.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
getTranslation(pseudoLocale)honor each message's resolvedformat(MF1|MF2|NONE) instead of always parsing as MF2.src/lib/pseudo-localize.tshelpers: MF2 AST walk, MF1 via@messageformat/parsercontent-offset rebuild (skipping function arg styles), and whole-string NONE.Closes #59
Test plan
npm test— 110 tests greenformat()still works for MF1/MF2/NONEnpx tsc --noEmitandnpm run buildcleannpm run coverage— 100% statements/lines (> 90%)