2020-05-17 10:12:13 +00:00
|
|
|
const path = require("path");
|
|
|
|
|
|
|
|
const yaml = require("gulp-yaml");
|
|
|
|
|
|
|
|
const translationsSourceDir = path.join(__dirname, "..", "translations");
|
2020-05-19 09:08:28 +00:00
|
|
|
const translationsJsonDir = path.join(__dirname, "..", "src", "js", "built-temp");
|
2020-05-17 10:12:13 +00:00
|
|
|
|
|
|
|
function gulptasksTranslations($, gulp, buildFolder) {
|
|
|
|
gulp.task("translations.convertToJson", () => {
|
|
|
|
return gulp
|
|
|
|
.src(path.join(translationsSourceDir, "*.yaml"))
|
|
|
|
.pipe($.plumber())
|
|
|
|
.pipe(yaml({ space: 2, safe: true }))
|
|
|
|
.pipe(gulp.dest(translationsJsonDir));
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task("translations.fullBuild", $.sequence("translations.convertToJson"));
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
gulptasksTranslations,
|
|
|
|
};
|