Comments (10)
Most likely it's because you set wrong path for source files. Look at the second line of your code:
return gulp.src('/js/*.js')
Notice the leading slash in the path. All other code works just fine at my test environment.
from gulp-xgettext.
One more thing: you probably should set language
option to JavaScript
like this:
gulp.task('generate-po', function() {
return gulp.src('./js/*.js')
.pipe(xgettext({
language: 'JavaScript',
keywords: [
{name: 'pojs._'}
],
headers: {
Language: 'en_EN'
}
}))
.pipe(concatPo('messages.po'))
.pipe(gulp.dest('./'));
});
from gulp-xgettext.
Nevertheless once I've replaced a path with relative one and set language
option I cannot reproduce the problem regardless of using concatPo
plugin.
Does concatPo
stand for gulp-concat-po
plugin?
from gulp-xgettext.
Yes it is
from gulp-xgettext.
Well, it's strange. My gulpfile is:
var gulp = require('gulp'),
concatPo = require('gulp-concat-po'),
xgettext = require('gulp-xgettext');
gulp.task('generate-po', function() {
return gulp.src('./js/*.js')
.pipe(xgettext({
language: 'JavaScript',
keywords: [
{name: 'pojs._'}
],
headers: {
Language: 'en_EN'
}
}))
.pipe(concatPo('messages.po'))
.pipe(gulp.dest('./'));
});
and contents of ./js/test.js
are:
var someText = pojs._('Reset');
Everything works are expected.
from gulp-xgettext.
But if I remove concatenation plugin, i get all files for which a task runs -> task view all files, and concatenation is not to blame.
Ok, I'm tray to replace path to relative, and write result later. Thanks.
from gulp-xgettext.
Are the contests of those files valid? I mean are they really .po files with extracted string or what?
from gulp-xgettext.
Yes it is, all generated .po files is valid, but empty
from gulp-xgettext.
Ok. Does setting language: 'JavaScript'
help?
from gulp-xgettext.
It seems that the problem is already solved. I'll reopen the issue if it does not :)
from gulp-xgettext.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-xgettext.