-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix PARJS-47 - Astro-adapter `languageTag()` not being set properly on windows
- Loading branch information
Showing
4 changed files
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@inlang/paraglide-js-adapter-astro": patch | ||
--- | ||
|
||
fix: `languageTag()` not being set properly on windows. This bug was caused by duplicate module instantiation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
inlang/source-code/paraglide/paraglide-js-adapter-astro/src/utilts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// vendored in from vite | ||
import path from "node:path" | ||
|
||
const windowsSlashRE = /\\/g | ||
function slash(p: string): string { | ||
return p.replace(windowsSlashRE, "/") | ||
} | ||
|
||
const isWindows = typeof process !== "undefined" && process.platform === "win32" | ||
|
||
export function normalizePath(id: string) { | ||
return path.posix.normalize(isWindows ? slash(id) : id) | ||
} |