diff --git a/.changeset/twelve-eggs-join.md b/.changeset/twelve-eggs-join.md new file mode 100644 index 0000000000..d1df23f5f6 --- /dev/null +++ b/.changeset/twelve-eggs-join.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix issue when process.env.LANG was longer than 5 characters diff --git a/packages/astro/src/core/logger.ts b/packages/astro/src/core/logger.ts index 4aaa5a6484..195094ba39 100644 --- a/packages/astro/src/core/logger.ts +++ b/packages/astro/src/core/logger.ts @@ -18,7 +18,7 @@ function getLoggerLocale(): string { // Check if language code is atleast two characters long (ie. en, es). // NOTE: if "c" locale is encountered, the default locale will be returned. if (extractedLocale.length < 2) return defaultLocale; - else return extractedLocale; + else return extractedLocale.substring(0, 5); } else return defaultLocale; }