翻訳ファイルをランタイムで読み込み
This commit is contained in:
parent
ec4d5857d8
commit
84b488a912
6 changed files with 46 additions and 33 deletions
15
gulpfile.ts
15
gulpfile.ts
|
@ -2,6 +2,7 @@
|
|||
* Gulp tasks
|
||||
*/
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as gulp from 'gulp';
|
||||
import * as ts from 'gulp-typescript';
|
||||
import * as rimraf from 'rimraf';
|
||||
|
@ -31,6 +32,18 @@ gulp.task('build:copy:fonts', () =>
|
|||
gulp.src('./node_modules/three/examples/fonts/**/*').pipe(gulp.dest('./built/client/assets/fonts/'))
|
||||
);
|
||||
|
||||
gulp.task('build:copy:locales', cb => {
|
||||
fs.mkdirSync('./built/client/assets/locales', { recursive: true });
|
||||
|
||||
const v = { '_version_': meta.version };
|
||||
|
||||
for (const [lang, locale] of Object.entries(locales)) {
|
||||
fs.writeFileSync(`./built/client/assets/locales/${lang}.${meta.version}.json`, JSON.stringify({ ...locale, ...v }), 'utf-8');
|
||||
}
|
||||
|
||||
cb();
|
||||
});
|
||||
|
||||
gulp.task('build:client:script', () => {
|
||||
return gulp.src(['./src/server/web/boot.js'])
|
||||
.pipe(replace('VERSION', JSON.stringify(meta.version)))
|
||||
|
@ -47,7 +60,7 @@ gulp.task('build:client:style', () => {
|
|||
.pipe(gulp.dest('./built/server/web/'));
|
||||
});
|
||||
|
||||
gulp.task('build:copy', gulp.parallel('build:copy:views', 'build:client:script', 'build:client:style', 'build:copy:fonts', () =>
|
||||
gulp.task('build:copy', gulp.parallel('build:copy:locales', 'build:copy:views', 'build:client:script', 'build:client:style', 'build:copy:fonts', () =>
|
||||
gulp.src([
|
||||
'./src/emojilist.json',
|
||||
'./src/server/web/views/**/*',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue