Created attachment 581979 [details] Patch to use the entry from POT instead of a completely new entry Description of problem: Add some new strings to a document, update POT files and then update the PO files. Completely new strings will end up in the PO files quoted twice: msgid "\"Creative Commons License Notice:\"" msgstr "" instead of the expected: msgid "Creative Commons License Notice:" msgstr "" Those strings also lack the automatic comments (#. Tag: para) and the flags. Everything is related to this block of code in Translate.pm: if ( !$matched ) { my $po = new Locale::PO( -msgid => $pot_id, -msgstr => '' ); $po_hash->{$pot_id} = $po; push( @out_arry, $po ); } At a first glance, you should just integrate the unmodified POT entry as per the attached patch, i.e. get this: if ( !$matched ) { push( @out_arry, $pot ); } This is a problem affecting publican 3.0 and it should definitely be fixed before release.
Thanks, excellent assessment and correct solution! To ssh://git.fedorahosted.org/git/publican.git 85436ed..d608d3e master -> master
(In reply to comment #0) > Created attachment 581979 [details] > Patch to use the entry from POT instead of a completely new entry > > Description of problem: > > Add some new strings to a document, update POT files and then update the PO > files. Completely new strings will end up in the PO files quoted twice: > > msgid "\"Creative Commons License Notice:\"" > msgstr "" > > instead of the expected: > > msgid "Creative Commons License Notice:" > msgstr "" > > Those strings also lack the automatic comments (#. Tag: para) and the flags. > > Everything is related to this block of code in Translate.pm: > > if ( !$matched ) { > my $po = new Locale::PO( -msgid => $pot_id, -msgstr => '' ); > $po_hash->{$pot_id} = $po; > push( @out_arry, $po ); > } > > At a first glance, you should just integrate the unmodified POT entry as per > the attached patch, i.e. get this: > > if ( !$matched ) { > push( @out_arry, $pot ); > } > > This is a problem affecting publican 3.0 and it should definitely be fixed > before release. follow steps above.
Verified. New content added to an .xml file is represented as expected in the newly generated .po file, with correct quotes and comments.