Skip to content

feat(i18n): wire locale switcher, verify translations, and add CI check#41

Open
legend4tech wants to merge 2 commits into
LabsCrypt:mainfrom
legend4tech:i18n-locale-switcher
Open

feat(i18n): wire locale switcher, verify translations, and add CI check#41
legend4tech wants to merge 2 commits into
LabsCrypt:mainfrom
legend4tech:i18n-locale-switcher

Conversation

@legend4tech

Copy link
Copy Markdown

Description

This PR resolves the outstanding internationalization (i18n) issues by wiring up the locale switcher, fixing missing translations, and introducing CI safeguards to prevent future locale drift.

What's Changed

  • Fixed English Fallthroughs: Audited es.json and tl.json and found 15 keys holding English copy (e.g. "Asset", "Liquidated", "Dashboard"). These have all been accurately translated to Spanish and Tagalog.
  • Wired Locale Switcher: Connected the settings page language dropdown to next-intl navigation hooks. Changing the language now actively updates the URL locale segment (e.g., /en/settings -> /es/settings) and naturally persists the choice via cookies.
  • Removed Legacy Notice: Removed the "Full i18n support is coming soon..." text from the settings page, as translations are now fully functional for English, Spanish, and Tagalog.
  • Added CI Drift Protection:
    • Added scripts/check-locales.js to rigorously flatten and compare every JSON key against en.json.
    • Added the npm run check-locales script to package.json.
    • Introduced .github/workflows/ci.yml to automatically run this parity check on pushes and PRs to main, ensuring no keys are ever missed or orphaned during development.

Out of Scope

  • Adding new locales beyond es and tl.
  • RTL (Right-to-Left) layout support (a future implementation plan has been drafted separately).

Checklist

  • Tested locale switcher locally (URL updates correctly).
  • Verified exactly 108 translation keys exist in all three language files.
  • Confirmed npm run check-locales passes without errors.
  • Pushed CI workflow for GitHub Actions.

closes #7

@ogazboiz ogazboiz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is good work, the locale switcher actually works (reads locale from useParams, routes by swapping the locale segment, correct for next-intl localePrefix always), you dropped the fake fr/pt/hi languages so the switcher list (en/es/tl) now matches middleware.ts, the tl.json translations are filled in, check-locales.js passes, and the ci.yml is valid. one fix before merge:

  1. prettier (the lint gate) fails on the 2 new files. run: npx prettier --write .github/workflows/ci.yml scripts/check-locales.js then commit.

heads up: the CI check you added only runs check-locales, not prettier/tsc, so it won't self-catch formatting, the repo npm run lint gate will. fix the prettier and i'll merge.

if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

@legend4tech

Copy link
Copy Markdown
Author

this is good work, the locale switcher actually works (reads locale from useParams, routes by swapping the locale segment, correct for next-intl localePrefix always), you dropped the fake fr/pt/hi languages so the switcher list (en/es/tl) now matches middleware.ts, the tl.json translations are filled in, check-locales.js passes, and the ci.yml is valid. one fix before merge:

  1. prettier (the lint gate) fails on the 2 new files. run: npx prettier --write .github/workflows/ci.yml scripts/check-locales.js then commit.

heads up: the CI check you added only runs check-locales, not prettier/tsc, so it won't self-catch formatting, the repo npm run lint gate will. fix the prettier and i'll merge.

if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

Done u can merge

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.

[Frontend] Complete real i18n for es and tl and guard parity in CI

2 participants