Fix Astro i18n default locale regression#3306
Merged
delucis merged 1 commit intowithastro:mainfrom Jul 16, 2025
Merged
Conversation
🦋 Changeset detectedLatest commit: 442b2a1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
delucis
approved these changes
Jul 16, 2025
Member
delucis
left a comment
There was a problem hiding this comment.
Oof, my poor API design choices bite again 😅 — really would be nice to refactor what the locale config looks like internally at some point to avoid having to remember to handle these edge cases everywhere.
Thanks for taking care of this one @HiDeoo!
Merged
HiDeoo
added a commit
to shubham-padia/starlight
that referenced
this pull request
Jul 16, 2025
* main: Exclude banner content from Pagefind indexing (withastro#3276) Restrict remark/rehype plugins usage (withastro#3274) [ci] release (withastro#3307) Fix Astro i18n default locale regression (withastro#3306) i18n(de): translate `plugins.mdx` and `community-content.mdx` (withastro#3304)
Yoxnear
pushed a commit
to Yoxnear/starlight-custom
that referenced
this pull request
Jul 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
rootis not present in thei18n.localesarray. #3305This PR fixes a regression introduced in #3288 where I forgot that if your default language is your root locale, you can skip the
defaultLocaleoption, but one can still specify it explicitly torootin the config.When transforming the Starlight i18n config to an Astro i18n config, we already have some logic in place to handle this when defining
paths, but I forgot to apply the same logic when defining thedefaultLocale.I also added a new test suite where the Starlight config explicitly sets the default locale to
root(we didn't have this before).