lingo.dev icon indicating copy to clipboard operation
lingo.dev copied to clipboard

fix/standardize locales across demo apps to match next-app

Open siddhesh1051 opened this issue 1 year ago • 0 comments

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-app as the source of truth for supported locales.
  • Update compiler configs to generate the same locales in each demo.
  • Update UI LocaleSwitcher components 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'
    • demo/adonisjs/inertia/pages/home.tsx
      • LocaleSwitcher locales → ['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.tsx
      • LocaleSwitcher locales → ["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 on targetLocales.

Attached the final video covering those 3 demo apps

https://github.com/user-attachments/assets/5cc8f8f9-c27e-4d2a-b0c6-f02a35972664

fixes #1324

siddhesh1051 avatar Oct 29 '25 20:10 siddhesh1051