This reverts commit 163c7ff791.
This commit is contained in:
1 parent
fe4946a269
commit
c8a52b78e1
62 files changed
+87
-175
No files matched your search
@@ -3,7 +3,7 @@ import { join } from "path";
|
||||
|
||||
const TEMPLATE_LANGUAGE = "en";
|
||||
const SPECIFIC_LOCALES = process.argv.slice(2) || [];
|
||||
const LOCALES_PATH = join(__dirname, "../../../packages/lib/server/locales");
|
||||
const LOCALES_PATH = join(__dirname, "../public/static/locales");
|
||||
|
||||
const ALL_LOCALES = readdirSync(LOCALES_PATH);
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const glob = require("glob");
|
||||
|
||||
const copyLocalesStatic = () => {
|
||||
const localeFiles = glob.sync("../../packages/lib/server/locales/**/*.json", { nodir: true });
|
||||
|
||||
localeFiles.forEach((file) => {
|
||||
const relativePath = file.replace("../../packages/lib/server/locales/", "");
|
||||
|
||||
// Create destination directory if it doesn't exist
|
||||
const destDir = path.join(process.cwd(), "public", "static", "locales", path.dirname(relativePath));
|
||||
if (!fs.existsSync(destDir)) {
|
||||
fs.mkdirSync(destDir, { recursive: true });
|
||||
}
|
||||
|
||||
// Copy file to destination
|
||||
const destPath = path.join(process.cwd(), "public", "static", "locales", relativePath);
|
||||
fs.copyFileSync(file, destPath);
|
||||
console.log(`Copied ${file} to ${destPath}`);
|
||||
});
|
||||
};
|
||||
|
||||
// Run the copy function
|
||||
copyLocalesStatic();
|
||||
Reference in new issue
Block a user