Skip to content

Commit

Permalink
fix replaceAll function
Browse files Browse the repository at this point in the history
  • Loading branch information
pettinarip committed Dec 10, 2022
1 parent d411fce commit 078c967
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/scripts/scanTranslations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ const input = ["./src/**/*.{ts,tsx}"]
const output = "./i18n"

function getNamespaceFromFilename(filename: string) {
console.log({ filename })
const file = path.parse(filename)
const dir = file.dir.slice(filename.indexOf("src/"))
const namespace = dir.replaceAll("/", "-") + "-" + file.name
const dir = file.dir.slice(filename.lastIndexOf("src/"))
const namespace = dir.replace(/\//g, "-") + "-" + file.name
return namespace
}

Expand Down

0 comments on commit 078c967

Please sign in to comment.