Browse Source

Add locale compilation to gulp

Denis K 8 years ago
parent
commit
55705ab454
2 changed files with 7 additions and 2 deletions
  1. 6 2
      gulpfile.js
  2. 1 0
      package.json

+ 6 - 2
gulpfile.js

@@ -12,7 +12,8 @@ var gulp = require('gulp'),
     merge = require('merge-stream'),
     postcss = require('gulp-postcss'),
     pxtorem = require('postcss-pxtorem'),
-    autoprefixer = require('autoprefixer');
+    autoprefixer = require('autoprefixer'),
+    shell = require('gulp-shell');
 
 var cssProcessors = [
     autoprefixer(),
@@ -95,11 +96,14 @@ gulp.task('vendor-translations', function() {
         .pipe(gulp.dest('./jet/static/jet/js/i18n/select2/'));
 });
 
-gulp.task('build', ['scripts', 'styles', 'vendor-styles', 'vendor-translations']);
+gulp.task('locales', shell.task('python manage.py compilemessages', { quiet: true }));
+
+gulp.task('build', ['scripts', 'styles', 'vendor-styles', 'vendor-translations', 'locales']);
 
 gulp.task('watch', function() {
     gulp.watch('./jet/static/jet/js/src/**/*.js', ['scripts']);
     gulp.watch('./jet/static/jet/css/**/*.scss', ['styles']);
+    gulp.watch('./jet/locale/**/*.po', ['locales']);
 });
 
 gulp.task('default', ['build', 'watch']);

+ 1 - 0
package.json

@@ -10,6 +10,7 @@
     "gulp-minify-css": "1.2.4",
     "gulp-postcss": "6.1.1",
     "gulp-sass": "2.3.2",
+    "gulp-shell": "0.5.2",
     "gulp-sourcemaps": "1.6.0",
     "gulp-uglify": "1.5.4",
     "jquery": "1.11.3",