From 8b333d407c59868f0605fb59a7c63eca4be7f48b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 1 Oct 2024 10:58:35 +0200 Subject: [PATCH] Bug 38048: Remove po2json deprecation warning (node:50086) [DEP0128] DeprecationWarning: Invalid 'main' field in '/kohadevbox/node_modules/po2json/package.json' of './lib/po2json'. Please either fix that or report it to the module author (Use `node --trace-deprecation ...` to show where the warning was created) See https://github.com/mikeedwards/po2json/issues/103 The project is not really maintained, so let's remove the warning on our side as a quick workaround. Test plan: Run `koha-translate --update es-ES --dev kohadev` --- misc/translator/LangInstaller.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm index fcf78bba98b..1aae53b39b6 100644 --- a/misc/translator/LangInstaller.pm +++ b/misc/translator/LangInstaller.pm @@ -457,7 +457,8 @@ sub install_messages { my $tmp_po = sprintf '/tmp/%s-messages.po', $self->{lang}; my $po2json_cmd = sprintf '%s %s %s', $self->{po2json}, $js_pofile, $tmp_po; - `$po2json_cmd`; + $po2json_cmd .= q{ 2> >(grep -v -e 'DEP0128' -e 'trace-deprecation' - )}; # Remove deprecation warning + `/usr/bin/bash -c "$po2json_cmd"`; # We need bash instead of sh (sh: 1: Syntax error: redirection unexpected) my $json = read_file($tmp_po); my $js_locale_data = sprintf 'var json_locale_data = {"Koha":%s};', $json; -- 2.34.1