fix various issues and change translation stuff

This commit is contained in:
MathMan05 2024-11-12 14:40:07 -06:00
parent 71aa1c0e9b
commit 8af8e4dd03
7 changed files with 821 additions and 821 deletions

View file

@ -6,6 +6,7 @@ const argv = require("yargs").argv;
const rimraf = require("rimraf");
const plumber = require("gulp-plumber");
const sourcemaps = require('gulp-sourcemaps');
const fs=require("fs");
const swcOptions = {
jsc: {
parser: {
@ -69,14 +70,21 @@ gulp.task("copy-html", () => {
.pipe(plumber()) // Prevent pipe breaking caused by errors
.pipe(gulp.dest("dist"));
});
gulp.task("copy-translations", () => {
let langs=fs.readdirSync("translations");
langs=langs.filter((e)=>e!=="qqq.json");
const langobj={};
for(const lang of langs){
const json=JSON.parse(fs.readFileSync("translations/"+lang).toString());
langobj[lang]=json.readableName;
}
if(!fs.existsSync("dist/webpage/translations")) fs.mkdirSync("dist/webpage/translations")
fs.writeFileSync("dist/webpage/translations/langs.js",`const langs=${JSON.stringify(langobj)};export{langs}`);
return gulp
.src("translations/*.json")
.pipe(plumber()) // Prevent pipe breaking caused by errors
.pipe(gulp.dest("dist/webpage/translations"));
});
// Task to copy other static assets (e.g., CSS, images)
gulp.task("copy-assets", () => {
return gulp