Skip to content

fix(link): set default for locale prop#6563

Open
neukinal wants to merge 1 commit into
nuxt:v4from
neukinal:fix/ulink-i18n
Open

fix(link): set default for locale prop#6563
neukinal wants to merge 1 commit into
nuxt:v4from
neukinal:fix/ulink-i18n

Conversation

@neukinal
Copy link
Copy Markdown

@neukinal neukinal commented Jun 5, 2026

🔗 Linked issue

Fixes #6558

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Explicitly define undefined as the default value for the locale prop. Without an explicit default, Vue's boolean casting implicitly casts the missing prop to false. This behavior previously caused auto-localization to be disabled by default.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@neukinal neukinal requested a review from benjamincanac as a code owner June 5, 2026 22:32
@github-actions github-actions Bot added the v4 #4488 label Jun 5, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2026

Ready to act? Review this PR in Change Stack to turn feedback into patch suggestions you can inspect and refine.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cfb6050e-7b29-43b0-8e60-05593be6c322

📥 Commits

Reviewing files that changed from the base of the PR and between dc05151 and 133ddd4.

📒 Files selected for processing (1)
  • src/runtime/components/Link.vue

📝 Walkthrough

Walkthrough

This PR updates the Link component's prop defaults to explicitly set locale: undefined. Previously, the locale prop lacked an explicit default in withDefaults, causing downstream localization logic to not function correctly. The change ensures the locale prop is treated as unset when not provided, allowing the component's conditional locale-awareness logic (which checks props.locale === false and uses props.locale when calling $localePath) to operate as intended.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: setting a default value for the locale prop in the Link component.
Description check ✅ Passed The description clearly explains the bug being fixed and references the linked issue, detailing why the explicit undefined default is necessary.
Linked Issues check ✅ Passed The PR directly addresses issue #6558 by fixing Vue's implicit boolean casting of the locale prop, enabling auto-localization by default as documented.
Out of Scope Changes check ✅ Passed The changes are narrowly scoped to the locale prop default in Link.vue and directly relate to resolving the linked issue requirement.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 5, 2026

npm i https://pkg.pr.new/@nuxt/ui@6563

commit: 133ddd4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[I18n] UButton and ULink do not translate locale by default

1 participant