Bug 818768 - [l10n] publican update_po badly merges new strings
Summary: [l10n] publican update_po badly merges new strings
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 3.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 3.0
Assignee: Jeff Fearn 🐞
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-03 22:20 UTC by Raphaël Hertzog
Modified: 2012-10-31 03:11 UTC (History)
3 users (show)

Fixed In Version: 3.0.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-31 03:11:05 UTC
Embargoed:


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

Description Raphaël Hertzog 2012-05-03 22:20:26 UTC
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 22:55:23 UTC
Thanks, excellent assessment and correct solution!

To ssh://git.fedorahosted.org/git/publican.git
   85436ed..d608d3e  master -> master

Comment 2 Michael Hideo 2012-06-08 02:01:02 UTC
(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 04:21:21 UTC
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.