今天刚好整理了一下繁体的打包问题,所以顺带做了基于 OpenCC 的 gulp 插件,在这里分享一下: https://github.com/aleen42/gulp-opencc
A Gulp plugin for convert chinese based on OpenCC.
This plugin is mainly used for converting Chinese in Gulp tasks defined in the file, gulpfile.js. As it is based on OpenCC, you can use it with passing options, in which you can specify the type of converting:
/** gulpfile.js */
const opencc = require('gulp-opencc');
gulp.task('convert-chinese', () => {
gulp.src('zh.json')
.pipe(opencc.default({
type: 's2tw'
}))
.pipe(rename('zh_TW.json'))
.pipe(gulp.dest('build/'));
});
Have an idea? Found a bug? See how to contribute.
MIT © aleen42
1
yinzhili 2017-11-08 09:41:14 +08:00
一直觉得“正體”这个词怪怪的。政治色彩太浓。
|