Skip to content

Document how i18n messages are extracted - #220

Open
greatest0fallt1me wants to merge 1 commit into
QuickLendX:mainfrom
greatest0fallt1me:docs/106-i18n-extraction
Open

Document how i18n messages are extracted#220
greatest0fallt1me wants to merge 1 commit into
QuickLendX:mainfrom
greatest0fallt1me:docs/106-i18n-extraction

Conversation

@greatest0fallt1me

Copy link
Copy Markdown

Summary

No i18n workflow was written down. There's no automated extraction tool -- messages are added by hand to `lib/i18n/messages.ts` -- so without docs, a contributor has to reverse-engineer the convention from `t.ts`/`messages.ts` and their tests every time.

Change

Adds `docs/i18n-message-extraction.md` (audience: contributors adding/changing user-facing copy):

  • Never hardcode copy in a component -- always `t(key)`.
  • Key naming convention (`..`, matching existing keys).
  • `es` is intentionally partial -- a translation is optional, not required in the same PR.
  • The three-step fallback chain (own locale → `DEFAULT_LOCALE` → raw key) and which steps warn, referencing `t.test.ts` for the executable version.
  • `DEFAULT_LOCALE`'s env override and its own fallback rules, referencing `messages.test.ts`.
  • A short checklist for adding a new string.

Cross-linked from the README.

Closes #106

There's no automated extraction tool (no CLI scanning for t(...)
calls) -- messages are added by hand to lib/i18n/messages.ts. Writes
down the process that replaces a tool: never hardcode user-facing
copy, key naming convention, the es partial-translation convention,
the three-step fallback chain (own locale -> DEFAULT_LOCALE -> raw
key) and its dev-only warnings, DEFAULT_LOCALE's env override, and a
checklist for adding a new string. Cross-linked from the README.
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.

Document how i18n messages are extracted

1 participant