diff options
author | 2022-02-24 21:38:31 +0100 | |
---|---|---|
committer | 2022-02-24 14:38:31 -0600 | |
commit | 2e5c3b512638bf06c7eb896fcf5cd8179fe91ca8 (patch) | |
tree | 6d454e9b54457ddd9b3a5c5f1ecdc492f2fa13e4 | |
parent | a9656e743b9c3c2c403ba4f67e013139c2ad6db3 (diff) | |
download | astro-2e5c3b512638bf06c7eb896fcf5cd8179fe91ca8.tar.gz astro-2e5c3b512638bf06c7eb896fcf5cd8179fe91ca8.tar.zst astro-2e5c3b512638bf06c7eb896fcf5cd8179fe91ca8.zip |
fix(core): Issue #2625. error with process.env.LANG larger than 5 (#2645)
* Update logger.ts
Solving #2625
* chore: add changeset
Co-authored-by: Nate Moore <nate@skypack.dev>
-rw-r--r-- | .changeset/twelve-eggs-join.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/logger.ts | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/twelve-eggs-join.md b/.changeset/twelve-eggs-join.md new file mode 100644 index 000000000..d1df23f5f --- /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 4aaa5a648..195094ba3 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; } |