From 3a5d8d51cac5d7811278002fda44f47d798da893 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 15 Jan 2025 14:30:00 +0100 Subject: [PATCH] Bug 38900: Provide info about the problematic strings The translation script explodes without meaningful error when "incorrect" structure is found (edit) Found when working on bug 38714, the translation script can break with an error that does not directly point to the problematic string [13:00:23] Error: Command failed: misc/translator/xgettext.pl --charset=UTF-8 -F -o /tmp/koha-2rwDEm/Koha-opac-bootstrap.pot -f /tmp/koha-2rwDEm/files Can't use an undefined value as a HASH reference at misc/translator/xgettext.pl line 131. at ChildProcess.exithandler (node:child_process:422:12) at ChildProcess.emit (node:events:517:28) at ChildProcess.emit (node:domain:552:15) at maybeClose (node:internal/child_process:1098:16) at ChildProcess._handle.onexit (node:internal/child_process:303:5) at Process.callbackTrampoline (node:internal/async_hooks:128:17) [13:00:23] 'po:update' errored after 992 ms Test plan: 0. Use main and confirm that `gulp po:update --lang LANG` returns successfully 1. Apply the first patch => The error is Can't use an undefined value as a HASH reference at misc/translator/xgettext.pl line 131, <$INPUT> line 80. 2. Apply this patch => The error is now: Incorrect structure found at ./koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt:230: '