Skip to content

docs(i18n): add comprehensive contributor guide for internationalization - #413

Merged
khaira777 merged 3 commits into
mainfrom
docs/384-i18n-contributor-guide
Aug 19, 2026
Merged

khaira777 merged 3 commits into
mainfrom
docs/384-i18n-contributor-guide

Conversation

@khaira777

Copy link
Copy Markdown
Contributor

Intent

docs(i18n): add comprehensive contributor guide for internationalization (#384)

What Changed

  • Added docs/i18n.md providing contributor guidelines for internationalization, including architecture overview, translation editing, language scaffolding (npm run i18n:add), and RTL layout support.
  • Updated CONTRIBUTING.md, README.md, and docs/README.md to link and index the new internationalization guide.

Risk Assessment

✅ Low: The changes are documentation-only additions and updates covering internationalization workflows, with accurate code examples and verified links.

Testing

Executed git diff whitespace checks, tested all relative markdown links across docs/i18n.md, docs/README.md, CONTRIBUTING.md, and README.md, verified npm run i18n:add scaffolding CLI options and atomic copy guarantees, validated cheat sheet script availability, and passed all i18n and RTL test suites with zero failures.

Evidence: i18n Documentation & Scaffolding Verification Log
=== Starting i18n Documentation & Architecture Verification ===

Checking relative markdown links in docs/i18n.md (18 total links)...
  ✓ All relative links in docs/i18n.md point to existing files.
Checking relative markdown links in docs/README.md (11 total links)...
  ✓ All relative links in docs/README.md point to existing files.
Checking relative markdown links in CONTRIBUTING.md (8 total links)...
  ✓ All relative links in CONTRIBUTING.md point to existing files.
Checking relative markdown links in README.md (15 total links)...
  ✓ All relative links in README.md point to existing files.
Testing npm run i18n:add helper behavior (scripts/i18n-add.cjs)...
  ✓ No-arg invocation outputs usage and exits 1
  ✓ Too many args invocation exits 1
  ✓ Invalid language codes rejected
  ✓ Refuses to overwrite existing language message files
  ✓ Scaffolding new language creates byte-for-byte canonical copy atomically
Verifying command cheat sheet in docs/i18n.md matches package.json...
  ✓ All 10 documented npm scripts exist in package.json.

✅ All i18n documentation, links, and command verifications passed.
Evidence: i18n Parity & Integrity Check Log

> [email protected] i18n:check
> npm run test:translations && tsc --noEmit -p frontend/tsconfig.json


> [email protected] test:translations
> ts-node --transpile-only -P tests/tsconfig.json tests/translations.test.ts

Translation integrity: en <-> es <-> pt <-> fa
  ✓ registry ↔ files consistent (4 languages, 4 files)
  en.json: 2061 leaf keys
  es.json: 2061 leaf keys
  pt.json: 2061 leaf keys
  fa.json: 2061 leaf keys
  ✓ no duplicate keys within translation files
  ✓ exact leaf key parity with en.json (no missing, no orphan keys)
  ✓ all leaves are non-empty strings (no empty objects/arrays/null/booleans/numbers)
  ✓ no malformed values
  ✓ all messages parse as valid ICU (plurals, selects, brackets)
  ✓ placeholder arguments and plural/select selectors match en.json in all locales
  ✓ rich-text tags match en.json in all locales
  ✓ no undefined keys (1790 literal t() calls covered)
  ✓ no unsafe template-literal t() calls (all dynamic keys exhaustively cast)
  ✓ no active frontend consumers import the legacy i18n bridge
  ✓ messages.d.ts AppConfig augmentation present (compile-time key checks active)
  ✓ no untranslated fa.json values (31 intentional shared values)

✅ All translation integrity checks passed.

Negative tests (fixture-based):
  ✓ all negative fixtures detected by their validators

✅ All translation integrity checks + negative tests passed.
Evidence: RTL Test Suites Verification Log

> [email protected] test:rtl-foundation
> ts-node --transpile-only -P tests/tsconfig.json tests/rtl-foundation.test.ts

RTL/LTR UI foundation checks:
  ✓ shared components use logical direction utilities (2 allowlisted physical cases)
  ✓ globals.css defines .ltr-island and .rtl-flip
  ✓ Ltr component renders dir="ltr" LTR islands through React interface

✅ All RTL/LTR foundation checks passed.

> [email protected] test:rtl-setup-auth-settings
> ts-node --transpile-only -P tests/tsconfig.json tests/rtl-setup-auth-settings.test.ts

RTL/LTR Setup, Auth, and Settings checks:
  ✓ batch screens use logical direction utilities (1 allowlisted physical cases)
  ✓ directional arrows carry rtl-flip (2 file(s) with arrows)
  ✓ Ltr polymorphic rendering (as="a", as="code") verified through React interface
  ✓ getBrowserLanguage resolves fa for fa* locales and defaults correctly
  ✓ setup.languagePersian and settings.languageFa translate across en, es, pt, fa

✅ All RTL/LTR Setup, Auth, and Settings checks passed.

> [email protected] test:rtl-dashboard-pos-common
> ts-node --transpile-only -P tests/tsconfig.json tests/rtl-dashboard-pos-common.test.ts

RTL/LTR Dashboard, POS, and common flow checks:
  ✓ batch screens use logical direction utilities (0 allowlisted physical cases)
  ✓ directional icons carry rtl-flip (3 file(s) with directional icons)
  ✓ icon-before-text gaps use me-* (inline-end), not ms-*
  ✓ DirectionalToaster dynamically adapts toast placement across RTL/LTR languages
  ✓ Ltr component isolates POS operational values (order #, phone, IP, VID, table, JSON)
  ✓ getLanguageDirection resolves direction from shared language metadata

✅ All RTL/LTR Dashboard, POS, and common flow checks passed.

> [email protected] test:rtl-kds-server-whatsapp
> ts-node --transpile-only -P tests/tsconfig.json tests/rtl-kds-server-whatsapp.test.ts

RTL/LTR KDS, Server App, and WhatsApp checks:
  ✓ batch screens use logical direction utilities (0 allowlisted physical cases)
  ✓ directional icons carry rtl-flip (2 file(s) with directional icons)
  ✓ naturally LTR values are isolated with Ltr (order #, elapsed time, phones, pairing code, money, LAN URLs)
  ✓ standalone layouts sync document dir/lang (KdsHtmlLang / HtmlLangSync)
  ✓ KDS disabled screens use localized i18n keys
  ✓ Server App inherits tenant language via /api/server-app/info (useSyncServerLanguage path)

✅ All RTL/LTR KDS, Server App, and WhatsApp checks passed.
- Outcome: ⚠️ 1 info across 1 run (2m13s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed ✅
  • ⚠️ docs/i18n.md:116 - In docs/i18n.md Step 2 (lines 116-140) and line 190, the example LANGUAGES configuration and field reference do not match the TypeScript LanguageConfig interface in frontend/src/lib/i18n/languages.ts: property direction is mistakenly written as dir, unnecessary properties id and name are listed in the object literal (which violates TypeScript's excess property checking), and load is written as returning m.default instead of matching () =&gt; import(&#39;./messages/de.json&#39;). Contributors copying this example will encounter TypeScript errors during npm run i18n:check.

🔧 Fix: align i18n guide LANGUAGES example with LanguageConfig interface
✅ Re-checked - no issues remain.

⚠️ **Test** - 1 info
  • ℹ️ tests/i18n-docs-verification.test.ts - new test file written by agent: tests/i18n-docs-verification.test.ts
  • git diff --check
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/i18n-docs-verification.test.ts
  • npm run i18n:check
  • npm run test:translations
  • npm run test:rtl-foundation
  • npm run test:rtl-setup-auth-settings
  • npm run test:rtl-dashboard-pos-common
  • npm run test:rtl-kds-server-whatsapp
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This documentation-only PR adds a comprehensive internationalization contributor guide and links it from the repository’s primary documentation indexes.

  • Documents translation editing, language registration, validation, and UI testing.
  • Describes RTL layout conventions and repository i18n commands.
  • Adds navigation links from CONTRIBUTING.md, README.md, and docs/README.md.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
docs/i18n.md Adds the internationalization architecture, translation workflow, language scaffolding, RTL guidance, and command reference.
CONTRIBUTING.md Links contributors to the new internationalization guide.
README.md Adds translation-contribution guidance and an internationalization documentation link.
docs/README.md Registers the internationalization guide in the current documentation index.

Reviews (2): Last reviewed commit: "docs(i18n): clarify test:translations sc..." | Re-trigger Greptile

Comment thread docs/i18n.md Resolved
Comment thread docs/i18n.md Resolved
@khaira777
khaira777 merged commit 7e648ed into main Aug 19, 2026
12 checks passed
@khaira777
khaira777 deleted the docs/384-i18n-contributor-guide branch August 19, 2026 23:49
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.

1 participant