feat(i18n): ✨ Add i18n management scripts for locale creation and deletion#727
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99ac1bb1fa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14c06ca21c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5040a40a9b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2cb1008a8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const enabled = React.useMemo( | ||
| () => languages.filter(language => language.enabled !== false), | ||
| [languages], |
There was a problem hiding this comment.
Filter disabled locales from the language switchers
When a locale has enabled: false, this only removes it from the context used by multilingual form fields. The site and admin headers pass the unfiltered vitNodeConfig.i18n.locales directly to LanguageSwitcher, which maps every locale into a selectable menu item, so users can still select a language that configuration says is disabled. Filter the shared locale configuration or make LanguageSwitcher exclude disabled entries as well.
Useful? React with 👍 / 👎.
| if ( | ||
| content.includes("defaultLocale") && | ||
| /locales\s*:\s*\[/.test(content) |
There was a problem hiding this comment.
Recognize partial API i18n configurations
When an API-only app declares i18n: { locales, messages } but relies on the supported implicit defaultLocale: "en", this predicate rejects the actual config source because it lacks the literal defaultLocale. As a result, i18n:delete deletes the locale JSON files but skips unwiring the config when sourceFile is null, leaving message loaders that import missing files while reporting that the language was removed. Detect the actual i18n/locales block without requiring an explicit default.
Useful? React with 👍 / 👎.
Improving Documentation
pnpm lint:fixto fix formatting issues before opening the PR.Description
What?
Why?