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 invalid Astro i18n config with a single root locale #1993

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Jun 10, 2024

Description

This PR fixes an issue in the generated Astro i18n config when using a single root locale. The issue boils down to 2 problems:

  • In our schema, we branch when we have a multilingual site or monolingual site with only 1 non-root locale. Altho, the existing check (configuredLocales.length >= 1) was not singling out a website with a single root locale.
  • In the Astro i18n config generation process, when the config locales is not defined (which is the case when for a site with only 1 root locale configured), the locales was always being the built-in default locale instead of the configured defaultLocale.

To test these changes, I added an entirely new test suite with a configuration using only a single root locale which is one suite we were missing.

Copy link

changeset-bot bot commented Jun 10, 2024

🦋 Changeset detected

Latest commit: f75c495

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

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

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

Copy link

vercel bot commented Jun 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview Jun 12, 2024 11:06am

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Jun 10, 2024
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Thank you for the fix @HiDeoo!

@delucis delucis added the 🌟 patch Change that triggers a patch release label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 core Changes to Starlight’s main package 🌟 patch Change that triggers a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Status 404 for existing pages
2 participants