0

I'm using angular-gettext to have a multi-language app in AngularJS

I cannot find the way to maintain the old translations and not overwrite them every time I extract them.

here is of my gulpfile.js

var gulp = require('gulp');
var gettext = require('gulp-angular-gettext');

gulp.task('translations:parse', function () {
return gulp.src([conf.paths.src + '/app/**/*.html', conf.paths.src + '/app/**/*.js'])
    .pipe(gettext.extract('translations.pot', {}))
    .pipe(gulp.dest(conf.paths.src + '/app/translations/'));
});

So the first time the file "translations.pot" is generated. If I make the translations directly in this file, and then run gulp translations:parse again, the translations saved in "translations.pot" will be lost.

So let's say I have in translations.pot

#: partials/home.html:3
msgid "Welcome"
msgstr "Bienvenido"

After running gulp translations:parse again, the translations are lost

#: partials/home.html:3
msgid "Welcome"
msgstr ""

Is there any possible solution for that? How can I save the old translations?

Thanks a lot Adrián Bolonio

4

1 回答 1

0

I've received an answer from the developer in GitHub

You're not meant to edit the .pot file, it's a template for updating your .po files.

Here's a guide on how to do translations correctly: https://angular-gettext.rocketeer.be/dev-guide/translate/

So problem solved :)

于 2015-11-30T11:37:40.523 回答