GithubHelp home page GithubHelp logo

Comments (10)

JustBlackBird avatar JustBlackBird commented on June 29, 2024

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.

JustBlackBird avatar JustBlackBird commented on June 29, 2024

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.

JustBlackBird avatar JustBlackBird commented on June 29, 2024

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.

makito avatar makito commented on June 29, 2024

Yes it is

from gulp-xgettext.

JustBlackBird avatar JustBlackBird commented on June 29, 2024

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.

makito avatar makito commented on June 29, 2024

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.

JustBlackBird avatar JustBlackBird commented on June 29, 2024

Are the contests of those files valid? I mean are they really .po files with extracted string or what?

from gulp-xgettext.

makito avatar makito commented on June 29, 2024

Yes it is, all generated .po files is valid, but empty

from gulp-xgettext.

JustBlackBird avatar JustBlackBird commented on June 29, 2024

Ok. Does setting language: 'JavaScript' help?

from gulp-xgettext.

JustBlackBird avatar JustBlackBird commented on June 29, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.