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(i18n): fix regression in current locale #9998
Conversation
🦋 Changeset detectedLatest commit: 3f0c6f1 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 |
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.
Fix looks good to me. A bit worried about the perf implication though since it has 3 nested loops, but we could revisit them next time. Also, is the two changesets intentional or should there only be one?
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
It's intentional, because the two bugs are unrelated (two different use cases), even though the function is the same. |
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Changes
Closes #9970
I reverted the change to use
pathname
instead forRouteData::route
..route
contains the actual name of the file e.g./blog/[...locale
, which is not what I needed.So, I reverted the code to use
RouteData::pathname
first and thenURL::pathname
in the former isn't present.RouteData::pathname
covers SSR cases.This PR also fixes another issue where
Astro.currentLocale
wasn't returning the correct value in case a locale is configured using thepath
propertyTesting
I added new test cases.
Docs
N/A