summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Swithinbank2024-08-06 11:32:48 +0200
committerGitHub2024-08-06 11:32:48 +0200
commit9ac7725dbe84f3fab9b191452471d8eaffd55048 (patch)
treed3985c1a516caa3be624e16205ee7f7d1128b853
parent4f120490e914fb308e909b97890a11bb95ae964c (diff)
downloadIT.starlight-9ac7725dbe84f3fab9b191452471d8eaffd55048.tar.gz
IT.starlight-9ac7725dbe84f3fab9b191452471d8eaffd55048.tar.bz2
IT.starlight-9ac7725dbe84f3fab9b191452471d8eaffd55048.zip
Define well-known RTL locales before calling `getLocaleInfo()` for default locale (#2167)
-rw-r--r--.changeset/odd-sheep-love.md5
-rw-r--r--packages/starlight/utils/i18n.ts6
2 files changed, 8 insertions, 3 deletions
diff --git a/.changeset/odd-sheep-love.md b/.changeset/odd-sheep-love.md
new file mode 100644
index 00000000..04a53315
--- /dev/null
+++ b/.changeset/odd-sheep-love.md
@@ -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
diff --git a/packages/starlight/utils/i18n.ts b/packages/starlight/utils/i18n.ts
index ce07b1cc..5ec66722 100644
--- a/packages/starlight/utils/i18n.ts
+++ b/packages/starlight/utils/i18n.ts
@@ -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.
@@ -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:
*