Skip to content
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 get relative locale #13045

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mtwilliams-code
Copy link
Contributor

Changes

fixes #13035
getLocaleRelativeUrl will now return a '/' instead of an empty string in the case of base: '/' and trailingSlash: 'never'.
Changing this behavior of getLocalRelativeUrl caused a similar error in getLocaleAbsoluteUrl for trailingSlash: 'never' because it internaly uses getLocaleRelativeUrl. This is resolved similarly.

Testing

Added tests for both cases - the logic for testing base: '/' had only been testing when trailingSlash:'always'.

Docs

Copy link

changeset-bot bot commented Jan 22, 2025

⚠️ No Changeset found

Latest commit: 7c5b4ac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 22, 2025
Copy link

codspeed-hq bot commented Jan 22, 2025

CodSpeed Performance Report

Merging #13045 will not alter performance

Comparing mtwilliams-code:fix-get-relative-locale (7c5b4ac) with main (f576519)

Summary

✅ 6 untouched benchmarks

@mtwilliams-code
Copy link
Contributor Author

oops gotta add the changeset

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Happy to merge once the changeset is ready :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getRelativeLocaleUrl returns an empty string
2 participants