Bug 35332 - gulp po:update (may) generates incorrect Koha-messages.pot
Summary: gulp po:update (may) generates incorrect Koha-messages.pot
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: translate.koha-community.org (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 35079
Blocks:
  Show dependency treegraph
 
Reported: 2023-11-14 11:45 UTC by Jonathan Druart
Modified: 2024-01-04 13:36 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2023-11-14 11:45:47 UTC
From bug 35079 comment 9, this is still valid.

[11:13:51] Error: Command failed: msgmerge --backup=off --no-wrap --quiet -F --update misc/translator/po/de-DE-messages.po misc/translator/Koha-messages.pot                                                         
misc/translator/Koha-messages.pot:11:35: syntax error                                                     
misc/translator/Koha-messages.pot:11: keyword "n" unknown                                                 
misc/translator/Koha-messages.pot:12: end-of-line within string                                                                                                                                                      
msgmerge: found 3 fatal errors                                                                            
                                                                                                          
    at ChildProcess.exithandler (node:child_process:419:12)                                                                                                                                                          
    at ChildProcess.emit (node:events:513:28)                                                             
    at ChildProcess.emit (node:domain:552:15)                                                             
    at maybeClose (node:internal/child_process:1091:16)                                                   
    at Socket.<anonymous> (node:internal/child_process:449:11)                                            
    at Socket.emit (node:events:513:28)                                                                                                                                                                              
    at Socket.emit (node:domain:552:15)                                                                   
    at Pipe.<anonymous> (node:net:321:12)                                                                                                                                                                            
    at Pipe.callbackTrampoline (node:internal/async_hooks:130:17)                                         
[11:13:51] 'po:update' errored after 31 s          


It's really hard to debug as it happens randomly.
It's either coming from the merge of the header or 2 processes writing into the same file at the same time

The problem is always the same, the extract of the strings generates line 11 of Koha-messages.pot with an extra quote:
  "Content-Transfer-Encoding: 8bit"\n"
instead of
  "Content-Transfer-Encoding: 8bit\n"

And so the update of the .tt fail because msgmerge fail to read the .pot file.
Comment 1 Jonathan Druart 2023-11-14 12:47:38 UTC
A workaround is to call several times po:extract with --task (bug 35103).