Skip to content

fix(cli): provider i18n usage#5143

Merged
zettca merged 1 commit intomasterfrom
fix/stuff2
Apr 16, 2026
Merged

fix(cli): provider i18n usage#5143
zettca merged 1 commit intomasterfrom
fix/stuff2

Conversation

@zettca
Copy link
Copy Markdown
Member

@zettca zettca commented Apr 15, 2026

@zettca zettca requested a review from a team as a code owner April 15, 2026 12:29
Copilot AI review requested due to automatic review settings April 15, 2026 12:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 withProvider HOC output with the local Provider so react-i18next hooks have an I18nextProvider in scope.
  • Simplify i18n instance 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",
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
fallbackLng: "en",
fallbackLng: "en",
load: "languageOnly",
supportedLngs: ["en"],

Copilot uses AI. Check for mistakes.
@github-actions github-actions Bot temporarily deployed to uikit-docs/pr-5143 April 15, 2026 12:34 Destroyed
@zettca zettca force-pushed the fix/stuff2 branch 2 times, most recently from 12eb102 to 411325a Compare April 15, 2026 12:36
- reverts #5055
- update docs URLs
@zettca zettca merged commit 34e3bec into master Apr 16, 2026
17 checks passed
@zettca zettca deleted the fix/stuff2 branch April 16, 2026 08:57
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.

3 participants