Fix an Astro i18n → Starlight i18n config conversion issue#2122
Merged
delucis merged 1 commit intoJul 10, 2024
Merged
Conversation
…gual sites with a root locale
🦋 Changeset detectedLatest commit: 7e24532 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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Merged
HiDeoo
added a commit
to HiDeoo/starlight
that referenced
this pull request
Jul 11, 2024
* main: [ci] release (withastro#2110) Style `code`, `hr` and `blockquote` within asides (withastro#2119) Fix an Astro i18n → Starlight i18n config conversion issue (withastro#2122) Add Starlight Examples to community content page (withastro#2109) added feedbackspark in showcase. (withastro#2116) i18n(zh-cn): Update `sidebar.mdx` (withastro#2114) i18n(zh-cn): Update `configuration.mdx` (withastro#2113)
14 tasks
This was referenced Aug 12, 2024
This was referenced Aug 19, 2024
This was referenced Aug 26, 2024
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
This PR fixes the issue identified in this comment.
When using Astro’s
i18nconfig for a multilingual site with a root locale (prefixDefaultLocaleset tofalse), theconfig.defaultLocale.localevalue was not being set correctly toundefinedas expected in this case when converting the config to a Starlight i18n config.This PR fixes the issue by checking for this specific case. No new tests are added as we already have tests covering this scenario but the expected Starlight i18n config output was incorrect so we just needed to update it.
Another potential, but more manual test, is to use the Astro’s
i18nconfig from #1923 in the documentation and visiting a non-existent page.