Skip to content

Commit

Permalink
fix: use unjs/pathe to resolve generated localized files paths across OS
Browse files Browse the repository at this point in the history
fixes #135
  • Loading branch information
yassinedoghri committed Mar 5, 2023
1 parent 0fcb53a commit da80a8d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/cli/generate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from "fs";
import { resolve } from "pathe";
import { AstroI18nextConfig } from "../types";
import {
getAstroPagesPath,
Expand Down Expand Up @@ -66,11 +67,13 @@ export const generate = (
const createLocaleFolder = showDefaultLocale ? true : isOtherLocale;

filesToGenerate.push({
path: resolveTranslatedAstroPath(
astroFilePath,
createLocaleFolder ? locale : undefined,
outputPath,
flatRoutes
path: resolve(
resolveTranslatedAstroPath(
astroFilePath,
createLocaleFolder ? locale : undefined,
outputPath,
flatRoutes
)
),
source: newFileContents,
});
Expand Down

0 comments on commit da80a8d

Please sign in to comment.