Replace react-intl with next-intl and consolidate lang files.

Migrate i18n from react-intl to next-intl, eliminating the formatjs
compilation pipeline. Translation files now live as nested JSON in
public/intl/messages/ (single source of truth), removing the duplicated
src/lang/ directory and the copy/compile build steps. The useMessages()
hook API is preserved so all 195+ consumer components are unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mike Cao 2026-02-07 01:48:32 -08:00
parent fed8d4c71a
commit a1890e9261
118 changed files with 18151 additions and 136657 deletions

View file

@ -11,7 +11,7 @@
},
"type": "module",
"scripts": {
"dev": "next dev -p 3001 --turbo",
"dev": "next dev -p 3003 --turbo",
"build": "npm-run-all check-env build-db check-db build-tracker build-geo build-app",
"start": "next start",
"build-docker": "npm-run-all build-db build-tracker build-geo build-app",
@ -23,7 +23,7 @@
"build-components": "tsup",
"build-tracker": "rollup -c rollup.tracker.config.js",
"build-prisma-client": "node scripts/build-prisma-client.js",
"build-lang": "npm-run-all format-lang compile-lang download-country-names download-language-names clean-lang",
"build-lang": "npm-run-all download-country-names download-language-names",
"build-geo": "node scripts/build-geo.js",
"build-db": "npm-run-all build-db-client build-prisma-client",
"build-db-schema": "prisma db pull",
@ -33,12 +33,6 @@
"check-db": "node scripts/check-db.js",
"check-env": "node scripts/check-env.js",
"copy-db-files": "node scripts/copy-db-files.js",
"extract-messages": "formatjs extract \"src/components/messages.ts\" --out-file build/extracted-messages.json",
"merge-messages": "node scripts/merge-messages.js",
"generate-lang": "npm-run-all extract-messages merge-messages",
"format-lang": "node scripts/format-lang.js",
"compile-lang": "formatjs compile-folder --ast build/messages public/intl/messages",
"clean-lang": "prettier --write ./public/intl/**/*.json",
"download-country-names": "node scripts/download-country-names.js",
"download-language-names": "node scripts/download-language-names.js",
"change-password": "node scripts/change-password.js",
@ -102,6 +96,7 @@
"lucide-react": "^0.543.0",
"maxmind": "^5.0.5",
"next": "^16.1.6",
"next-intl": "^4.8.2",
"node-fetch": "^3.2.8",
"npm-run-all": "^4.1.5",
"papaparse": "^5.5.3",
@ -111,7 +106,6 @@
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-error-boundary": "^4.0.4",
"react-intl": "^7.1.14",
"react-resizable-panels": "^4.6.0",
"react-simple-maps": "^2.3.0",
"react-use-measure": "^2.0.4",
@ -127,7 +121,6 @@
},
"devDependencies": {
"@biomejs/biome": "^2.3.14",
"@formatjs/cli": "^4.2.29",
"@netlify/plugin-nextjs": "^5.15.7",
"@rollup/plugin-alias": "^5.0.0",
"@rollup/plugin-commonjs": "^25.0.4",
@ -143,7 +136,6 @@
"babel-plugin-react-compiler": "19.1.0-rc.2",
"cross-env": "^10.1.0",
"cypress": "^13.6.6",
"extract-react-intl-messages": "^4.1.1",
"husky": "^9.1.7",
"jest": "^29.7.0",
"lint-staged": "^16.2.6",