Set up i18next with lazy per-route catalogs
Wire i18next into the compliance portal with a custom backend built on import.meta.glob, so each _locales/*.json becomes its own lazily loaded chunk keyed by a namespace derived from the folder path. The active language is resolved from the browser, collapsing any fr*/en* tag to fr-FR/en-US with en-US as the ultimate fallback; fallbackLng then only covers individual missing keys. Add an app-level default namespace catalog and switch the documents page title to a translation key to exercise the lazy-loading path. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -63,6 +63,12 @@ export default defineConfig([
|
||||
message:
|
||||
"Use useMutation from #/lib/relay/useMutation, not react-relay.",
|
||||
},
|
||||
{
|
||||
name: "i18next",
|
||||
importNames: ["default"],
|
||||
message:
|
||||
"Don't import i18next's default (global singleton). Build a dedicated instance via `import { createInstance } from \"i18next\"`.",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user