Skip to content

Conversation

@SkyeYoung
Copy link
Member

@SkyeYoung SkyeYoung commented May 11, 2025

Please answer these questions before submitting a pull request, or your PR will get closed.

Why submit this pull request?

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What changes will this PR take into?

depend on #3040, #3041

Copy link
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

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

Copy link
Contributor

@bzp2010 bzp2010 May 13, 2025

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

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be typescript?

Copy link
Member Author

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.

Copy link
Member Author

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

Copy link
Member

@LiteSun LiteSun left a 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

@SkyeYoung SkyeYoung requested a review from LiteSun May 14, 2025 01:57
@SkyeYoung
Copy link
Member Author

This PR contains two features and should be split

rollbacked eslint part.

@SkyeYoung SkyeYoung changed the title refactor(i18n): reduce unnecessary keys, add eslint rules refactor(i18n): reduce unnecessary keys May 14, 2025
@SkyeYoung SkyeYoung merged commit 2ed9f63 into apache:master May 14, 2025
5 checks passed
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