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
|
||
|---|---|---|
| .. | ||
| LangInstaller.pm | ||
| TmplTokenizer.pm | ||
| VerboseWarnings.pm | ||
| po2json | ||
| tmpl_process3.pl | ||
| translate | ||
| xgettext-installer | ||
| xgettext-pref | ||
| xgettext-tt2 | ||
| xgettext.pl | ||