Repository navigation
refactor(i18n): convert flat translation keys to nested message format - #396
Merged
Merged
Conversation
- Convert all 4 locale files (en/es/pt/fa) from flat dotted keys to nested JSON objects (2,053 leaves each, 100% key/value parity, round-trip verified) - Update the t() compatibility adapter to resolve dotted keys by traversing the nested message tree (target language -> English -> raw key fallback) - Update tests/translations.test.ts to flatten nested leaves for parity checks and to scope duplicate-key detection to each object - Update tests/e2e-argentina-flow.test.ts to extract keys from nested JSON No translation wording changes; no keys added or removed. Refs #374
This was referenced Aug 19, 2026
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.
Intent
Implement FloCafe issue #374, the second sub-issue of epic #372 (convert flat translation keys to nested message format). Convert all 4 locale files (en/es/pt/fa) from flat dotted keys to nested JSON objects while preserving 100% leaf key/value parity (no wording changes, no keys added or removed). Update the t() compatibility adapter in frontend/src/lib/i18n.ts to resolve dotted keys by traversing the nested message tree with target-language -> English -> raw-key fallback. Update tests/translations.test.ts to flatten nested leaves for parity/validation and scope duplicate-key detection per object, and update tests/e2e-argentina-flow.test.ts to extract keys from nested JSON. This branch stacks on #373 (refactor/372-i18n-use-intl-foundation, PR #395) because #374 depends on #373 and that PR is not yet merged. Do NOT change translation wording, add/remove keys, introduce ICU features, migrate components, or remove the legacy t() adapter.
What Changed
en.json,es.json,pt.json,fa.json) from flat dotted keys to nested JSON message objects while preserving existing leaf keys and values.t()infrontend/src/lib/i18n.tswith aresolveMessagehelper to resolve dotted translation keys against nested message trees with English and raw key fallback.tests/translations.test.tsandtests/e2e-argentina-flow.test.ts) to recursively flatten nested message trees for parity checks and scope duplicate-key validation per JSON object.Risk Assessment
✅ Low: Translation bundles were converted to nested JSON format with 100% leaf key/value parity across all 4 locales, and the t() resolution adapter safely preserves fallback behavior.
Testing
Executed targeted automated validation including base-commit leaf key parity verification across all 4 locales (en/es/pt/fa, 2053 keys each), runtime t() compatibility adapter resolution and fallback hierarchy tests, ICU plural/parameter interpolation suites, RTL/LTR layout integration tests, and Playwright Chromium rendering of localized Auth, POS Cart, Settings, and KDS surfaces in EN, ES, PT, and FA, with all tests passing and 24 visual evidence artifacts captured.
/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/01_auth_login_en_ltr.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/01_auth_login_es_ltr.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/01_auth_login_pt_ltr.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/01_auth_login_fa_rtl.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/02_pos_cart_en_ltr.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/02_pos_cart_es_ltr.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/02_pos_cart_pt_ltr.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/02_pos_cart_fa_rtl.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/03_settings_locale_en_ltr.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/03_settings_locale_fa_rtl.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/04_kds_orders_en_ltr.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/04_kds_orders_fa_rtl.png)Evidence: Auth Login HTML (EN - LTR)
/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/01_auth_login_es_ltr.html) - Evidence: Auth Login HTML (PT - LTR) (local file:/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/01_auth_login_pt_ltr.html) - Evidence: Auth Login HTML (FA - RTL) (local file:/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/01_auth_login_fa_rtl.html) - Evidence: POS Cart HTML (EN - LTR) (local file:/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/02_pos_cart_en_ltr.html) - Evidence: POS Cart HTML (ES - LTR) (local file:/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/02_pos_cart_es_ltr.html) - Evidence: POS Cart HTML (PT - LTR) (local file:/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/02_pos_cart_pt_ltr.html) - Evidence: POS Cart HTML (FA - RTL) (local file:/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/02_pos_cart_fa_rtl.html) - Evidence: Settings Locale HTML (EN - LTR) (local file:/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/03_settings_locale_en_ltr.html) - Evidence: Settings Locale HTML (FA - RTL) (local file:/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/03_settings_locale_fa_rtl.html) - Evidence: KDS Orders HTML (EN - LTR) (local file:/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/04_kds_orders_en_ltr.html) - Evidence: KDS Orders HTML (FA - RTL) (local file:/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0BPTD7NNV01RDYGJE0APAX0/04_kds_orders_fa_rtl.html) - Outcome:Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
tests/issue-374-nested-messages-verification.test.ts- new test file written by agent: tests/issue-374-nested-messages-verification.test.tsnpm run test:translationsnpm run test:e2e-argentina-flownpm run test:rtl-foundationnpm run test:rtl-setup-auth-settingsnpm run test:rtl-dashboard-pos-commonnpm run test:rtl-kds-server-whatsappnpx ts-node --transpile-only -P tests/tsconfig.json tests/issue-374-nested-messages-verification.test.tsnpx ts-node --transpile-only -P tests/tsconfig.json tests/issue-241-localized-errors.test.tsnpx ts-node --transpile-only -P tests/tsconfig.json tests/browser-receipts.test.ts✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.