-
Notifications
You must be signed in to change notification settings - Fork 581
refactor(i18n): reduce unnecessary keys #3042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(i18n): reduce unnecessary keys #3042
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request refactors i18n keys to reduce unnecessary duplications and adds new ESLint rules for better code consistency and performance. Key changes include:
- Renaming and reorganizing i18n keys in locale files and updating component references accordingly.
- Updating component usages to reference new i18n keys (e.g. "form/upstreams" instead of "form/upstream") and messages (e.g. "info.delete.success" instead of "msg.delete.success").
- Adding ESLint plugins and rules related to i18n and import sorting.
Reviewed Changes
Copilot reviewed 57 out of 58 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/locales/en/common.json | Reorganized i18n keys and removed redundant entries. |
| src/config/navRoutes.ts | Updated type for label key to reference new i18n keys. |
| src/components/page/ToAddPageBtn.tsx | Updated translation key for the view button label. |
| src/components/page/DeleteResourceBtn.tsx | Updated translation keys for delete confirmation messages. |
| src/components/page-slice/plugin_metadata/PluginMetadata.tsx | Changed translation key for success messages in plugin metadata operations. |
| src/components/page-slice/consumers/DetailCredentialsTabs.tsx | Updated translation keys for credential and consumer details. |
| Other component and form slice files | Refactored translation key usages to reference the new "upstreams" group. |
| package.json & eslint.config.js | Added ESLint plugins and updated rules for i18n. |
| src/components/Navbar.tsx | Updated i18n key reference; potential variable naming issue. |
| src/components/Header/index.tsx | Updated logo and header labels to use new translation keys. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to use a standard language representation, such as zh_hans or en_US, so that the browser can automatically select the appropriate language?
Just a little inspiration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not controlled by this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be typescript?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me deal with this in a separate PR. I remember this thing doesn't play very well with TS.
… into young/refactor/reduce-i18n-keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added single quotes related rule, so there is a modification
LiteSun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR contains two features and should be split
rollbacked eslint part. |
Please answer these questions before submitting a pull request, or your PR will get closed.
Why submit this pull request?
What changes will this PR take into?
depend on #3040, #3041