Browse Source

chore: check i18n with CI

Gerald 7 năm trước cách đây
mục cha
commit
0314c17d9a
3 tập tin đã thay đổi với 10 bổ sung2 xóa
  1. 0 1
      .travis.yml
  2. 9 0
      gulpfile.js
  3. 1 1
      package.json

+ 0 - 1
.travis.yml

@@ -7,5 +7,4 @@ node_js:
 cache: yarn
 script:
   - yarn lint
-  - yarn i18n
   - yarn test

+ 9 - 0
gulpfile.js

@@ -102,6 +102,14 @@ function copyFiles() {
   .pipe(gulp.dest(DIST));
 }
 
+function checkI18n() {
+  return gulp.src(paths.templates)
+  .pipe(i18n.extract({
+    base: 'src/_locales',
+    extension: '.json',
+  }));
+}
+
 function copyI18n() {
   return gulp.src(paths.templates)
   .pipe(plumber(logError))
@@ -143,3 +151,4 @@ exports.clean = clean;
 exports.dev = gulp.series(gulp.parallel(pack, jsDev), watch);
 exports.build = gulp.parallel(pack, jsProd);
 exports.i18n = updateI18n;
+exports.check = checkI18n;

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
     "analyze": "webpack --profile --json --config scripts/webpack.conf.js | webpack-bundle-size-analyzer",
     "analyze:json": "webpack --profile --json --config scripts/webpack.conf.js > stats.json",
     "i18n": "gulp i18n",
-    "lint": "eslint --ext .js,.vue .",
+    "lint": "eslint --ext .js,.vue . && gulp check",
     "svgo": "svgo --config .svgo.yml src/resources/icons",
     "pretest": "cross-env NODE_ENV=test webpack --config scripts/webpack.test.conf.js",
     "test": "node dist/test",