Skip to content

Commit

Permalink
fix(core): Issue #2625. error with process.env.LANG larger than 5 (#2645
Browse files Browse the repository at this point in the history
)

* Update logger.ts

Solving #2625

* chore: add changeset

Co-authored-by: Nate Moore <[email protected]>
  • Loading branch information
xavikortes and Nate Moore committed Feb 24, 2022
1 parent a9656e7 commit 2e5c3b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/twelve-eggs-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix issue when process.env.LANG was longer than 5 characters
2 changes: 1 addition & 1 deletion packages/astro/src/core/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2e5c3b5

Please sign in to comment.