Conversation
There was a problem hiding this comment.
Pull request overview
Reintroduces the app-shell Vite baseline’s i18n provider wiring (reverting the prior “remove redundant provider” change) and updates the i18n initialization code used by the CLI-generated template.
Changes:
- Wrap
withProviderHOC output with the localProvidersoreact-i18nexthooks have anI18nextProviderin scope. - Simplify
i18ninstance initialization and memoization logic, and adjust inline documentation URL.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/cli/src/baselines/app-shell/vite/src/providers/Provider.tsx | Restores wrapping of generated pages/components with the i18n Provider via the withProvider HOC. |
| packages/cli/src/baselines/app-shell/vite/src/lib/i18n.ts | Refactors i18n instance creation/config and changes memoization pattern for the template’s i18n singleton. |
| // init i18next | ||
| // for all options read: https://www.i18next.com/overview/configuration-options | ||
| .init<HttpBackendOptions>({ | ||
| fallbackLng: "en", |
There was a problem hiding this comment.
i18next is using LanguageDetector, but the template only ships public/locales/en/.... Without load: "languageOnly" and/or supportedLngs: ["en"], locales like en-US will trigger backend requests for /locales/en-US/... that don't exist (404/extra round-trips) before falling back to en. Consider restoring load: "languageOnly" (and/or restricting supportedLngs) to match the baseline locale folder structure.
| fallbackLng: "en", | |
| fallbackLng: "en", | |
| load: "languageOnly", | |
| supportedLngs: ["en"], |
12eb102 to
411325a
Compare
- reverts #5055 - update docs URLs
HvProvider🤦)supportedLngsto reduce maintenance effort of adding a new language