Koha-clms/misc/translator
Jonathan Druart 311ba8e039
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: '<option value="*" ' at misc/translator/xgettext.pl line 124, <$INPUT> line 100.

Which is way more interesting to fix the problem as we know exactly
where the problem comes from

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3a5d8d51ca)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:02 +00:00
..
LangInstaller.pm Bug 38085: Pick multiple_sortable options for translation 2024-10-25 16:41:39 +02:00
TmplTokenizer.pm Bug 35043: Use Locale::PO->quote 2023-10-27 16:45:52 -03:00
VerboseWarnings.pm Bug 17600: Fix tests 2021-07-16 09:47:01 +02:00
po2json Bug 38164: Skip fuzzy translations 2024-10-18 17:44:17 +02:00
tmpl_process3.pl Bug 39077: Do not complain about obsolete translations 2025-04-17 14:30:36 +02:00
translate Bug 25067: Move PO file manipulation code into gulp tasks 2020-11-06 09:46:11 +01:00
xgettext-installer Bug 31292: Untranslatable string in sample_notices.yaml 2022-08-08 13:10:56 -03:00
xgettext-pref Bug 38085: Pick multiple_sortable options for translation 2024-10-25 16:41:39 +02:00
xgettext-tt2 Bug 25067: Move PO file manipulation code into gulp tasks 2020-11-06 09:46:11 +01:00
xgettext.pl Bug 38900: Provide info about the problematic strings 2025-08-06 09:57:02 +00:00