Skip to content

Commit

Permalink
Define well-known RTL locales before calling getLocaleInfo() for de…
Browse files Browse the repository at this point in the history
…fault locale (withastro#2167)
  • Loading branch information
delucis committed Aug 6, 2024
1 parent 4f12049 commit 9ac7725
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-sheep-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Fixes an issue detecting the built-in locale when running Starlight in a web container environment on Firefox
6 changes: 3 additions & 3 deletions packages/starlight/utils/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import type { AstroConfig } from 'astro';
import { AstroError } from 'astro/errors';
import type { StarlightConfig } from './user-config';

/** Informations about the built-in default locale used as a fallback when no locales are defined. */
export const BuiltInDefaultLocale = { ...getLocaleInfo('en'), lang: 'en' };

/**
* A list of well-known right-to-left languages used as a fallback when determining the text
* direction of a locale is not supported by the `Intl.Locale` API in the current environment.
Expand All @@ -14,6 +11,9 @@ export const BuiltInDefaultLocale = { ...getLocaleInfo('en'), lang: 'en' };
*/
const wellKnownRTL = ['ar', 'fa', 'he', 'prs', 'ps', 'syc', 'ug', 'ur'];

/** Informations about the built-in default locale used as a fallback when no locales are defined. */
export const BuiltInDefaultLocale = { ...getLocaleInfo('en'), lang: 'en' };

/**
* Processes the Astro and Starlight i18n configurations to generate/update them accordingly:
*
Expand Down

0 comments on commit 9ac7725

Please sign in to comment.