Skip to content

feat(resource): inherit unspecified message lang, dir, and dnt - #66

Merged
jsahleen merged 3 commits into
mainfrom
msg-64
Aug 16, 2026
Merged

feat(resource): inherit unspecified message lang, dir, and dnt#66
jsahleen merged 3 commits into
mainfrom
msg-64

Conversation

@jsahleen

Copy link
Copy Markdown
Collaborator

Summary

  • translate() (and therefore getTranslation()) now merges unspecified message lang, dir, and dnt from the translated resource, matching the merge add() / create() already performed.
  • Compact translation JSON that omits attributes (or lists only overrides) no longer falls through to DEFAULT_ATTRIBUTES (und / auto / false).
  • format preservation is unchanged. README and GETTING_STARTED document the inheritance next to format.

Closes #64.

Test plan

  • create with omitted attributes and partial { dnt } / { lang } overrides
  • translate with omitted attributes and partial overrides
  • getTranslation with a compact loader payload and with on-disk zh JSON
  • Existing format-preservation tests still pass
  • npm test, npx tsc --noEmit, npm run build, npm run coverage (> 90%)

Made with Cursor

jsahleen and others added 3 commits August 15, 2026 19:46
Compact translation JSON omits attributes; translate currently falls
through to DEFAULT_ATTRIBUTES instead of the resource. Refs #64

Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse add() so compact translation messages pick up the translated
resource lang, dir, and dnt while still preserving format. Refs #64

Co-authored-by: Cursor <cursoragent@cursor.com>
Point README and GETTING_STARTED at the same merge create, add,
translate, and getTranslation now share. Refs #64

Co-authored-by: Cursor <cursoragent@cursor.com>
@jsahleen
jsahleen marked this pull request as ready for review August 16, 2026 01:48
@jsahleen
jsahleen merged commit f1e03dd into main Aug 16, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jsahleen
jsahleen deleted the msg-64 branch August 19, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inherit unspecified message lang, dir, and dnt from the resource

1 participant