Replace grunt-xgettext by xgettext shell

grunt-xgettext does not support ECMAScript 6.

issue11368
review382291002
This commit is contained in:
Cédric Krier committed 2022-04-04 20:16:41 +02:00
1 parent bfca497f69
commit ecfc1ce90e
2 files changed
+15 -15

No files matched your search

+15 -14
View File
@@ -37,17 +37,6 @@ module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
xgettext: {
locale: {
files: {
javascript: jsfiles
},
options: {
functionName: "Sao.i18n.gettext",
potFile: "locale/messages.pot"
},
}
},
shell: {
options: {
failOnError: true
@@ -55,8 +44,20 @@ module.exports = function(grunt) {
msgmerge: {
command: _.map(locales, function(locale) {
var po = "locale/" + locale + ".po";
return "msgmerge -U " + po + " locale/messages.pot;";
return (
"msgmerge " +
"-U " + po + " " +
"--no-location " +
"locale/messages.pot;");
}).join("")
},
xgettext: {
command: (
"xgettext " +
"--language=JavaScript --from-code=UTF-8 " +
"--omit-header --no-location " +
"-o locale/messages.pot " +
jsfiles.join(" "))
}
},
po2json: {
@@ -170,8 +171,8 @@ module.exports = function(grunt) {
grunt.task.run(['shell:msgmerge']);
});
grunt.registerTask('xgettext', ' Extracts translatable messages', function() {
grunt.loadNpmTasks('grunt-xgettext');
grunt.task.run(['xgettext']);
grunt.loadNpmTasks('grunt-shell');
grunt.task.run(['shell:xgettext']);
});
grunt.registerTask('test', 'Run tests', function() {
grunt.loadNpmTasks('grunt-contrib-qunit');
-1
View File
@@ -40,7 +40,6 @@
"grunt-contrib-qunit": "^3.1",
"grunt-contrib-watch": "^1.1",
"grunt-shell": "^3.0",
"grunt-xgettext": "^0.3",
"grunt-po2json": "^0.3"
},
"keywords": [