Files
fusion/i18next.config.ts
gsxdsm e703bdd608 feat(i18n): add Korean locale + localized READMEs with language switcher
- ko added to SUPPORTED_LOCALES and every enumeration site (config,
  settings enum, help text, tests); Korean catalogs authored for all
  current keys; CLI bundles regenerated for 6 locales; 한국어 endonym
- README translated into zh-CN, zh-TW, fr, es, ko; every README carries
  a language-switcher line and the localized ones note that English is
  canonical

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 17:33:16 -07:00

47 lines
1.5 KiB
TypeScript

import {
defineConfig,
recommendedAcceptedAttributes,
recommendedAcceptedTags,
} from "i18next-cli";
/**
* i18next-cli workflow config for the whole monorepo.
*
* - `extract` pulls t()/<Trans> keys from the dashboard and CLI source into the
* authored `en` catalogs under @fusion/i18n.
* - `sync` propagates the `en` key structure to the four other locales.
* - `types` regenerates key types from the `en` catalogs.
* - `status` reports per-locale completion (CI gate).
* - `lint` flags hardcoded user-facing strings (primary guardrail).
*
* Namespaces are routed by the `ns:` prefix in keys / `useTranslation(ns)` in
* source, not by file path. `common` is the default namespace.
*/
export default defineConfig({
locales: ["en", "zh-CN", "zh-TW", "fr", "es", "ko"],
extract: {
input: [
"packages/dashboard/app/**/*.{ts,tsx}",
"packages/cli/src/**/*.{ts,tsx}",
"!**/__tests__/**",
"!**/*.test.*",
],
output: "packages/i18n/locales/{{language}}/{{namespace}}.json",
primaryLanguage: "en",
defaultNS: "common",
keySeparator: ".",
nsSeparator: ":",
// Untranslated secondary-locale keys stay empty so `status` can measure
// real completion; the active locale falls back to `en` at runtime.
defaultValue: "",
},
types: {
input: ["packages/i18n/locales/en/*.json"],
output: "packages/i18n/src/i18next-resources.d.ts",
},
lint: {
acceptedTags: recommendedAcceptedTags,
acceptedAttributes: recommendedAcceptedAttributes,
},
});