2022-12-03 04:23:18 +00:00
|
|
|
import path from "path/posix";
|
|
|
|
|
import fs from "fs";
|
|
|
|
|
import gulpYaml from "gulp-yaml";
|
|
|
|
|
import YAML from "yaml";
|
2020-09-29 18:40:55 +00:00
|
|
|
|
2022-12-03 04:23:18 +00:00
|
|
|
import gulpPlumber from "gulp-plumber";
|
2020-09-29 18:40:55 +00:00
|
|
|
|
2022-12-03 04:23:18 +00:00
|
|
|
const translationsSourceDir = path.join("..", "translations");
|
|
|
|
|
const translationsJsonDir = path.join("..", "src", "js", "built-temp");
|
|
|
|
|
|
|
|
|
|
export default function gulptasksTranslations(gulp) {
|
2020-09-29 18:40:55 +00:00
|
|
|
gulp.task("translations.convertToJson", () => {
|
|
|
|
|
return gulp
|
|
|
|
|
.src(path.join(translationsSourceDir, "*.yaml"))
|
2022-12-03 04:23:18 +00:00
|
|
|
.pipe(gulpPlumber())
|
2020-09-29 18:40:55 +00:00
|
|
|
.pipe(gulpYaml({ space: 2, safe: true }))
|
|
|
|
|
.pipe(gulp.dest(translationsJsonDir));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gulp.task("translations.fullBuild", gulp.series("translations.convertToJson"));
|
|
|
|
|
}
|