docs: improve route disable guide - #4120
Conversation
WalkthroughThe documentation updates heading levels and describes the effects of disabling localized routes. It also documents route-group configuration through the Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/content/docs/02.guide/04.ignoring-localized-routes.md`:
- Around line 108-110: Update the page.path condition in the localized-route
example to match /account as a path segment, not merely as a string prefix,
while continuing to match /login and valid /account subroutes without affecting
paths such as /accounting or /account-settings.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8d4453f0-d339-448b-a833-d15c500b05ed
📒 Files selected for processing (3)
docs/content/docs/02.guide/04.ignoring-localized-routes.mdspecs/fixtures/basic/pages/define-i18n-route-false.vuespecs/routing_strategies/prefix.spec.ts
| if (page.path.startsWith('/account') || page.path === '/login') { | ||
| page.meta ??= {} | ||
| page.meta.i18n = false |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Match the /account path by segment.
page.path.startsWith('/account') also matches /accounting and /account-settings. This example can disable localization for routes outside the documented /account section.
Proposed fix
- if (page.path.startsWith('/account') || page.path === '/login') {
+ if (
+ page.path === '/account' ||
+ page.path.startsWith('/account/') ||
+ page.path === '/login'
+ ) {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (page.path.startsWith('/account') || page.path === '/login') { | |
| page.meta ??= {} | |
| page.meta.i18n = false | |
| if ( | |
| page.path === '/account' || | |
| page.path.startsWith('/account/') || | |
| page.path === '/login' | |
| ) { | |
| page.meta ??= {} | |
| page.meta.i18n = false |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/content/docs/02.guide/04.ignoring-localized-routes.md` around lines 108
- 110, Update the page.path condition in the localized-route example to match
/account as a path segment, not merely as a string prefix, while continuing to
match /login and valid /account subroutes without affecting paths such as
/accounting or /account-settings.
🔗 Linked issue
📚 Description
This is a gap in our documentation, right now it's unclear that disabling i18n through the meta property or other custom route configuration that this only disables route localization and that i18n is otherwise functioning as normal on such a page.
The documentation is generated, maybe it's a bit too verbose in its current state, so might iterate before merging.
Summary by CodeRabbit
Documentation
Bug Fixes