Repository navigation
Closed
Labels
Description
Context
Following the migration to a Git-native use-intl architecture, adding a new language to FloCafe is a simple, structured process. This issue creates a complete contributor guide documenting how translators and developers can contribute translations, add new languages, and handle RTL layouts natively via Git and GitHub pull requests.
What to Document
Create a comprehensive guide at docs/i18n.md and link to it from CONTRIBUTING.md and README.md.
1. For Translators (Editing / Improving Existing Languages)
- How to fork the repository, locate the relevant message file in
frontend/src/lib/i18n/messages/<lang>.json, and edit values. - What must NOT be translated:
- JSON keys and namespace identifiers
- ICU placeholder variable names (e.g.
{count},{time},{price}) - HTML/rich-text tag names where used (e.g.
<bold>,<link>,<ltr>)
- Explanation of ICU MessageFormat syntax (plurals, select statements) to prevent broken formatting strings.
- How to run local validation (
npm run i18n:check) and submit a Pull Request.
2. For Developers (Adding a New Language)
Step-by-step workflow:
- Create message file: Copy
frontend/src/lib/i18n/messages/en.jsontofrontend/src/lib/i18n/messages/<lang>.json. (Or runnpm run i18n:add -- <lang>if available). - Register language: Add an entry in
frontend/src/lib/i18n/languages.tsspecifyinglocale,nativeName,direction('ltr'|'rtl'),selectable, and chunkload()function. - Translate values: Translate strings while maintaining 100% key and variable parity with
en.json. - Validate: Run
npm run i18n:checkto verify leaf parity, ICU syntax, parameter matching, and tag parity. - Test in UI: Verify rendering in both desktop and standalone modes.
- Submit PR: Open a standard GitHub PR.
3. RTL Language Support Guidelines
- Setting
direction: 'rtl'inlanguages.ts. - How
HtmlLangSyncautomatically manages<html dir="rtl">in sync with active loaded locale. - Using
<Ltr>islands for naturally-LTR content (emails, URLs, phone numbers, bill IDs, timestamps). - Using
.rtl-flipCSS class for mirroring directional icons (arrows, chevrons). - Running existing RTL test suites (
npm run test:rtl-foundation,npm run test:rtl-setup-auth-settings, etc.).
4. Language Enablement vs. Strict Repository Completeness
- Explain that all committed language files in the repository must maintain strict 100% key parity with
en.json. - Explain how a language can exist and function technically in the repository while remaining hidden from end users (
selectable: false). - Reference Persian (feat(i18n): add Persian/Farsi and Iran support #241) as the standard example of an in-progress language undergoing staged UI/UX acceptance.
5. Architectural Overview
- Flow: Git message files -> Language Registry (
languages.ts) -> Active Locale Loader (loader.ts) ->use-intl-> React UI /createTranslator. - Offline-first architecture (zero external translation network dependencies).
- Typed domain enum mappings (
enums.ts). - Standalone KDS and Server App language synchronization (
server-language.ts).
6. Separation of UI Languages vs. Country/Tax Profiles
- Explicitly clarify that adding a UI language is separate from configuring country tax packs, currencies, and dialing codes in
main/countries.ts. Link to country documentation without conflating the two workflows.
What NOT to do
- Do NOT reference Crowdin, Weblate, or any external SaaS platform.
- Do NOT suggest editing core application components when adding a language.
- Do NOT conflate UI language translation with tax pack or country profile creation.
Acceptance Criteria
-
docs/i18n.mdcreated with clear, actionable guidelines for translators and developers. - Discoverable link added in
CONTRIBUTING.md. - Workflow accurately reflects the Git-native
use-intlarchitecture. - RTL guidelines, strict key parity invariant, and language selectability (
selectable: false) clearly explained.
Verification
- Verify that all file links and code examples in
docs/i18n.mdmatch the current codebase. - Verify that following the documented steps successfully adds a test locale that passes
npm run i18n:check.
Activity
docs(i18n): add comprehensive contributor guide for internationalizat…
khaira777 commentedon Aug 19, 2026
Completed by #413 (merged into main at commit 7e648ed). Created comprehensive internationalization and translation contributor guide at docs/i18n.md, added links in docs/README.md, CONTRIBUTING.md, and README.md, and verified all relative markdown paths and code examples.