Skip to content

Fix get relative locale#13045

Merged
ematipico merged 4 commits into
withastro:mainfrom
mtwilliams-code:fix-get-relative-locale
Jan 24, 2025
Merged

Fix get relative locale#13045
ematipico merged 4 commits into
withastro:mainfrom
mtwilliams-code:fix-get-relative-locale

Conversation

@mtwilliams-code

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

@changeset-bot

changeset-bot Bot commented Jan 22, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 867f835

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label Jan 22, 2025
@codspeed-hq

codspeed-hq Bot commented Jan 22, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #13045 will not alter performance

Comparing mtwilliams-code:fix-get-relative-locale (867f835) with main (a90f79f)

Summary

✅ 6 untouched benchmarks

@mtwilliams-code

Copy link
Copy Markdown
Contributor Author

oops gotta add the changeset

@ematipico ematipico left a comment

Copy link
Copy Markdown
Member

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 :)

Comment thread .changeset/seven-avocados-confess.md Outdated
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