Bug 818768 - [l10n] publican update_po badly merges new strings
[l10n] publican update_po badly merges new strings
Status: CLOSED CURRENTRELEASE
Product: Publican
Classification: Community
Component: publican (Show other bugs)
3.0
Unspecified Unspecified
unspecified Severity high
: 3.0
: ---
Assigned To: Jeff Fearn
tools-bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-03 18:20 EDT by Raphaël Hertzog
Modified: 2012-10-30 23:11 EDT (History)
3 users (show)

See Also:
Fixed In Version: 3.0.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-30 23:11:05 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to use the entry from POT instead of a completely new entry (518 bytes, patch)
2012-05-03 18:20 EDT, Raphaël Hertzog
no flags Details | Diff

  None (edit)
Description Raphaël Hertzog 2012-05-03 18:20:26 EDT
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.
Comment 1 Jeff Fearn 2012-05-03 18:55:23 EDT
Thanks, excellent assessment and correct solution!

To ssh://git.fedorahosted.org/git/publican.git
   85436ed..d608d3e  master -> master
Comment 2 Michael Hideo 2012-06-07 22:01:02 EDT
(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.
Comment 3 Hedda Peters 2012-06-14 00:21:21 EDT
Verified. 

New content added to an .xml file is represented as expected in the newly generated .po file, with correct quotes and comments.

Note You need to log in before you can comment on or make changes to this bug.