details:   https://code.tryton.org/tryton/commit/17fae2c73637
branch:    default
user:      Cédric Krier <[email protected]>
date:      Mon Oct 12 15:38:15 2026 +0200
description:
        Replace grunt-po2json by po2json to convert po to json
diffstat:

 .gitlab-ci.yml   |   4 ++--
 sao/Gruntfile.js |  25 +++++++++++++++----------
 sao/README.md    |   4 ++--
 sao/package.json |   2 +-
 4 files changed, 20 insertions(+), 15 deletions(-)

diffs (103 lines):

diff -r a072b431ccd5 -r 17fae2c73637 .gitlab-ci.yml
--- a/.gitlab-ci.yml    Wed Oct 14 12:37:19 2026 +0200
+++ b/.gitlab-ci.yml    Mon Oct 12 15:38:15 2026 +0200
@@ -164,7 +164,7 @@
       - .cache/npm
   script:
     - cd sao
-    - npm install --cache ${NODE_CACHE_DIR} --unsafe-perm --legacy-peer-deps
+    - npm install --cache ${NODE_CACHE_DIR} --unsafe-perm
     - npm run check
   rules:
     - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
@@ -318,7 +318,7 @@
       - .cache/npm
   script:
     - cd "${PACKAGE}"
-    - npm -s install --cache ${NODE_CACHE_DIR} --unsafe-perm --legacy-peer-deps
+    - npm -s install --cache ${NODE_CACHE_DIR} --unsafe-perm
     - npm test
   artifacts:
     reports:
diff -r a072b431ccd5 -r 17fae2c73637 sao/Gruntfile.js
--- a/sao/Gruntfile.js  Wed Oct 14 12:37:19 2026 +0200
+++ b/sao/Gruntfile.js  Mon Oct 12 15:38:15 2026 +0200
@@ -1,3 +1,7 @@
+const fs = require("fs");
+const path = require("path");
+const po2json = require("po2json");
+
 module.exports = function(grunt) {
 
   var _ = grunt.util._;
@@ -62,15 +66,6 @@
                 jsfiles.join(" "))
         }
     },
-    po2json: {
-        options: {
-            format: 'raw'
-        },
-        all: {
-            src: ['locale/*.po'],
-            dest: 'locale/'
-        }
-    },
     concat: {
         dist: {
             src: jsfiles,
@@ -120,9 +115,19 @@
 
   grunt.loadNpmTasks('grunt-contrib-concat');
   grunt.loadNpmTasks('grunt-contrib-less');
-  grunt.loadNpmTasks('grunt-po2json');
   grunt.loadNpmTasks('grunt-qunit-junit');
 
+  grunt.registerTask(
+      "po2json", "Convert locale/*.po files to JSON", function() {
+          for (const src of grunt.file.expand("locale/*.po")) {
+              let catalog = po2json.parse(fs.readFileSync(src));
+              let dest = path.join(
+                  path.dirname(src), `${path.basename(src, ".po")}.json`);
+              grunt.file.write(dest, `${JSON.stringify(catalog)}\n`);
+              grunt.log.writeln(`${src} → ${dest}`);
+          }
+      });
+
   grunt.registerTask('default', 'Build', function() {
     grunt.task.run(['concat', 'less', 'po2json']);
     });
diff -r a072b431ccd5 -r 17fae2c73637 sao/README.md
--- a/sao/README.md     Wed Oct 14 12:37:19 2026 +0200
+++ b/sao/README.md     Mon Oct 12 15:38:15 2026 +0200
@@ -12,14 +12,14 @@
 Once you've downloaded and unpacked the sao source release, enter the directory
 where the archive was unpacked, and run:
 
-    $ npm install --production --legacy-peer-deps
+    $ npm install --production
 
 Development
 ...........
 
 For development, you have to run instead:
 
-    $ npm install --legacy-peer-deps
+    $ npm install
     $ grunt
 
 Setup
diff -r a072b431ccd5 -r 17fae2c73637 sao/package.json
--- a/sao/package.json  Wed Oct 14 12:37:19 2026 +0200
+++ b/sao/package.json  Mon Oct 12 15:38:15 2026 +0200
@@ -45,9 +45,9 @@
     "grunt-contrib-nodeunit": "^5.0",
     "grunt-contrib-qunit": "^10.1",
     "grunt-contrib-watch": "^1.1",
-    "grunt-po2json": "^0.3",
     "grunt-qunit-junit": "^0.3.1",
     "grunt-shell": "^4.0",
+    "po2json": "^1.0.0-beta-3",
     "qunit": "^2.24.1"
   },
   "keywords": [

Reply via email to