-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
fix: extra menu title follow locale change #5006
Conversation
|
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
packages/effects/layouts/src/basic/layout.vueOops! Something went wrong! :( ESLint: 9.16.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/node_modules/@vben/eslint-config/dist/index.mjs' imported from /eslint.config.mjs Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/effects/layouts/src/basic/layout.vue (1)
113-125
: LGTM! Consider enhancing the documentation.The implementation correctly addresses the locale change issue by allowing selective depth translation. The code is well-structured and type-safe.
Consider adding a code example in the documentation to illustrate the difference between deep and shallow translation:
/** * 包装菜单,翻译菜单名称 * @param menus 原始菜单数据 * @param deep 是否深度包装。对于双列布局,只需要包装第一层,因为更深层的数据会在扩展菜单中重新包装 + * @example + * // Deep translation (default) + * wrapperMenus(menus) // translates all nested levels + * // Shallow translation + * wrapperMenus(menus, false) // translates only first level */
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
packages/effects/layouts/src/basic/layout.vue
(2 hunks)
🔇 Additional comments (1)
packages/effects/layouts/src/basic/layout.vue (1)
269-269
: LGTM! Verify menu translation behavior.
The change correctly implements shallow translation for mixed-menu while maintaining deep translation for extra menus.
Let's verify the menu translation behavior across different components:
✅ Verification successful
Menu translation configuration is correctly implemented
The verification confirms that:
- The
wrapperMenus
function is consistently used across different menu components - Mixed menu (headerMenus) correctly uses shallow translation with
false
parameter - Extra menu still uses deep translation (default
true
parameter) - Other menu instances maintain their expected translation behavior
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify consistent usage of wrapperMenus across menu components
# Check if wrapperMenus is used correctly in all menu-related components
echo "Checking wrapperMenus usage in menu components..."
rg -A 2 "wrapperMenus\(" --type vue
# Verify that LayoutExtraMenu still uses deep translation
echo "Verifying LayoutExtraMenu translation depth..."
rg -A 5 "LayoutExtraMenu" --type vue
Length of output: 342
Script:
#!/bin/bash
# Let's try without specifying file type since 'vue' is not recognized
# Search for wrapperMenus usage
echo "Checking wrapperMenus usage..."
rg -A 2 "wrapperMenus\("
# Search for LayoutExtraMenu
echo "Verifying LayoutExtraMenu..."
rg -A 5 "LayoutExtraMenu"
Length of output: 2837
Description
修复双列菜单布局下,子级扩展菜单的语言没有跟随当前语言设置动态更新的问题
Type of change
Please delete options that are not relevant.
pnpm-lock.yaml
unless you introduce a new test example.Checklist
pnpm run docs:dev
command.pnpm test
.feat:
,fix:
,perf:
,docs:
, orchore:
.Summary by CodeRabbit