lingo.dev
lingo.dev copied to clipboard
fix/standardize locales across demo apps to match next-app
Overview
Aligned all demo apps to a single, consistent locale set used by next-app: ar, de, en, es, fr, ja, ko, ru, zh. This ensures consistent DX and parity across demos. No manual dictionary edits are needed; dictionaries/meta are generated by the compiler during dev/build.
Approach
- Adopt
next-appas the source of truth for supported locales. - Update compiler configs to generate the same locales in each demo.
- Update UI
LocaleSwitchercomponents to expose the same locale list. - Committed auto generated dictionary.js
Changes
- AdonisJS
demo/adonisjs/vite.config.ts- targetLocales → ['es', 'ja', 'fr', 'ru', 'de', 'zh', 'ar', 'ko'] with
sourceLocale: 'en'
- targetLocales → ['es', 'ja', 'fr', 'ru', 'de', 'zh', 'ar', 'ko'] with
demo/adonisjs/inertia/pages/home.tsxLocaleSwitcherlocales → ['en','ar','de','es','fr','ja','ko','ru','zh']
- React Router
demo/react-router-app/vite.config.ts- targetLocales → ["ar","de","es","fr","ja","ko","ru","zh"]
demo/react-router-app/app/root.tsxLocaleSwitcherlocales → ["en","ar","de","es","fr","ja","ko","ru","zh"]
- Next.js
- Already set to the canonical list; no changes.
Notes
- Dictionaries (
lingo/dictionary.js) and metadata (lingo/meta.json) are auto-generated by the compiler during dev/build based ontargetLocales.
Attached the final video covering those 3 demo apps
https://github.com/user-attachments/assets/5cc8f8f9-c27e-4d2a-b0c6-f02a35972664
fixes #1324