Skip to content

Commit

Permalink
fix: use fileURLToPath to normalize publicDir pathname accross operat…
Browse files Browse the repository at this point in the history
…ing systems

fixes #79
  • Loading branch information
yassinedoghri committed Jan 8, 2023
1 parent 224b056 commit 3c07d6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
deeplyStringifyObject,
getUserConfig,
} from "./utils";
import { fileURLToPath } from "url";

export default (options?: AstroI18nextOptions): AstroIntegration => {
const customConfigPath = options?.configPath;
Expand Down Expand Up @@ -74,7 +75,7 @@ export default (options?: AstroI18nextOptions): AstroIntegration => {
initImmediate: false,
backend: {
loadPath:
config.publicDir.pathname + "locales/{{lng}}/{{ns}}.json",
fileURLToPath(config.publicDir) + "locales/{{lng}}/{{ns}}.json",
},
...astroI18nextConfig.i18nextServer,
};
Expand Down

0 comments on commit 3c07d6a

Please sign in to comment.