mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-08 00:34:42 +03:00
Add gulp task for .pot file generation
This commit is contained in:
parent
547cd5abb6
commit
f583aa6439
@ -14,7 +14,9 @@ var fs = require('fs'),
|
|||||||
zip = require('gulp-zip'),
|
zip = require('gulp-zip'),
|
||||||
tar = require('gulp-tar'),
|
tar = require('gulp-tar'),
|
||||||
gzip = require('gulp-gzip'),
|
gzip = require('gulp-gzip'),
|
||||||
chmod = require('gulp-chmod');
|
chmod = require('gulp-chmod'),
|
||||||
|
xgettext = require('gulp-xgettext'),
|
||||||
|
concatPo = require('gulp-concat-po');
|
||||||
|
|
||||||
// Set global configs.
|
// Set global configs.
|
||||||
var config = {
|
var config = {
|
||||||
@ -143,6 +145,32 @@ gulp.task('page-styles', function() {
|
|||||||
.pipe(gulp.dest(stylePath + '/templates_compiled/client_side'));
|
.pipe(gulp.dest(stylePath + '/templates_compiled/client_side'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Generate .pot files based on the sources
|
||||||
|
gulp.task('generate-pot', function() {
|
||||||
|
return gulp.src([
|
||||||
|
config.mibewPath + '/**/*.php',
|
||||||
|
'!' + config.phpVendorPath + '/**/*.*',
|
||||||
|
'!' + config.pluginsPath + '/**/*.*'
|
||||||
|
])
|
||||||
|
.pipe(xgettext({
|
||||||
|
language: 'PHP',
|
||||||
|
keywords: [
|
||||||
|
{name: 'getlocal'}
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
.pipe(concatPo('translation.pot', {
|
||||||
|
headers: {
|
||||||
|
'Project-Id-Version': config.package.version,
|
||||||
|
'Report-Msgid-Bugs-To': config.package.bugs.email,
|
||||||
|
'PO-Revision-Date': '',
|
||||||
|
'Last-Translator': '',
|
||||||
|
'Language-Team': '',
|
||||||
|
'Content-Type': 'text/plain; charset=UTF-8'
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest('release'));
|
||||||
|
});
|
||||||
|
|
||||||
// Pack sources to .zip and .tar.gz archives.
|
// Pack sources to .zip and .tar.gz archives.
|
||||||
gulp.task('pack-sources', ['composer-install'], function() {
|
gulp.task('pack-sources', ['composer-install'], function() {
|
||||||
var sources = config.mibewPath + '/**/*',
|
var sources = config.mibewPath + '/**/*',
|
||||||
@ -162,7 +190,7 @@ gulp.task('pack-sources', ['composer-install'], function() {
|
|||||||
// Builds all the sources
|
// Builds all the sources
|
||||||
gulp.task('default', function(callback) {
|
gulp.task('default', function(callback) {
|
||||||
runSequence(
|
runSequence(
|
||||||
['phpcs', 'js', 'chat-styles', 'page-styles'],
|
['phpcs', 'js', 'chat-styles', 'page-styles', 'generate-pot'],
|
||||||
'pack-sources',
|
'pack-sources',
|
||||||
callback
|
callback
|
||||||
);
|
);
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
"version": "2.0.0-alpha2",
|
"version": "2.0.0-alpha2",
|
||||||
"description": "Mibew Messenger - open-source live support application",
|
"description": "Mibew Messenger - open-source live support application",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"bugs": {
|
||||||
|
"email": "support@mibew.org",
|
||||||
|
"url": "https://github.com/mibew/mibew/issues"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "~3.8.0",
|
"gulp": "~3.8.0",
|
||||||
"gulp-phpcs": "~0.1.0",
|
"gulp-phpcs": "~0.1.0",
|
||||||
@ -16,6 +20,8 @@
|
|||||||
"gulp-tar": "~1.0.0",
|
"gulp-tar": "~1.0.0",
|
||||||
"gulp-gzip": "~0.0.8",
|
"gulp-gzip": "~0.0.8",
|
||||||
"gulp-chmod": "~1.1.0",
|
"gulp-chmod": "~1.1.0",
|
||||||
|
"gulp-xgettext": "~0.2.0",
|
||||||
|
"gulp-concat-po": "~0.1.0",
|
||||||
"run-sequence": "~0.3.6",
|
"run-sequence": "~0.3.6",
|
||||||
"event-stream": "~3.1.7"
|
"event-stream": "~3.1.7"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user