Bug 35332

Summary: gulp po:update (may) generates incorrect Koha-messages.pot
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: translate.koha-community.orgAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: julian.maurice
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35103
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 35079    
Bug Blocks:    

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).