Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion gulp/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ gulp.task(
'copy-binary-style-css',
'copy-binary-style-img',
'copy-js',
'pull-blockly-translations',
done => {
genHtml(true);
done();
Expand All @@ -77,6 +78,7 @@ gulp.task(
'copy-jquery-img',
'copy-binary-style-css',
'copy-binary-style-img',
'copy-js'
'copy-js',
'pull-blockly-translations'
)
);
19 changes: 17 additions & 2 deletions gulp/i18n.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const gulp = require('gulp');
const del = require('del');
const fs = require('fs');
const gulp = require('gulp');
const hash = require('sha1');
const del = require('del');
const paths = require('vinyl-paths');
const remoteSrc = require('gulp-remote-src');
const rename = require('gulp-rename');
const scanner = require('i18next-scanner');
require('./static');

Expand Down Expand Up @@ -77,3 +79,16 @@ gulp.task(
.pipe(gulp.dest('./'))
)
);

gulp.task(
'pull-blockly-translations',
gulp.series(done => {
const blocklyLanguages = ['en', 'de', 'id', 'it', 'vi', 'pl', 'ru', 'pt', 'es', 'fr', 'zh-hans', 'zh-hant'];
remoteSrc(blocklyLanguages.map(lang => `${lang}.js?_=${Date.now()}`), {
base: 'https://blockly-demo.appspot.com/static/msg/js/',
})
.pipe(rename(path => (path.extname = '.js')))
.pipe(gulp.dest('www/translations'));
done();
})
);
Loading