Bug 8573 - Translation difficult in picture-upload.tt due to nested sentence in if/foreach/if/elsif - construction
Summary: Translation difficult in picture-upload.tt due to nested sentence in if/forea...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: 3.8
Hardware: All All
: P3 normal
Assignee: Marc Véron
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-06 07:59 UTC by Marc Véron
Modified: 2013-12-05 19:59 UTC (History)
6 users (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
Bug 8573 - Translation difficult in picture-upload.tt due to nested sentence in if/foreach/if/elsif - construction (4.12 KB, patch)
2012-08-06 08:53 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 8573 - Translation difficult in picture-upload.tt due to nested sentence in if/foreach/if/elsif - construction (4.30 KB, patch)
2012-08-10 03:57 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 8573 - Translation difficult in picture-upload.tt due to nested sentence in if/foreach/if/elsif - construction (5.02 KB, patch)
2012-08-10 04:23 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8573 - Translation difficult in picture-upload.tt due to nested sentence in if/foreach/if/elsif - construction (5.05 KB, patch)
2012-08-10 06:22 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2012-08-06 07:59:24 UTC
The following code in 
koha-tmpl/intranet-tmpl/prog/en/modules/tools/picture-upload.tt 
leads in Pootle to a situation where a correct ranslation is simply not possible:

------------
                        [% IF ( COUNT.TCOUNTS ) %]<li>[% COUNT.TCOUNTS %] image(s) moved into the database:</li>[% END %]
                        [% FOREACH filename IN COUNT.filenames %]
                            <li>[% filename.source %] - Cardnumber: [% filename.cardnumber %]
                                    [% IF ( filename.filerrors ) %]<br /> <b>WARNING:</b> This image <i>not</i> imported because
                                    [% FOREACH filerror IN filename.filerrors %]
                                        [% IF ( filerror.DBERR ) %]the database returned an error. Please refer to the error log for more details.</li>
                                        [% ELSIF ( filerror.IMGEXISTS ) %]this patron does not exist in the database.</li>
                                        [% ELSIF ( filerror.MIMERR ) %]the image format is unrecognized.</li>
                                        [% ELSIF ( filerror.CORERR ) %]the image file is corrupted.</li>
                                        [% ELSIF ( filerror.OPNERR ) %]Koha was unable to open the image for reading.</li>
                                        [% ELSIF ( filerror.OVRSIZ ) %]the image file is too big.</li>
                                        [% ELSIF ( filerror.CRDFIL ) %]the [% filerror.CRDFIL %] is missing.</li>
                                        [% ELSE %]of an unknown error. Please refer to the error log for more details.</li>[% END %]
                                    [% END %]
                                        [% ELSE %] imported successfully.</li>
                                    [% END %]
                        [% END %]
----------------------


Pootle separates this poorly:

"imported because %s %sthe database returned an error. Please refer to the error log for more details."

"imported because" then is missing for all following if/elsif branches, leading to mutilated sentences.
Comment 1 Marc Véron 2012-08-06 08:53:20 UTC Comment hidden (obsolete)
Comment 2 Julian Maurice 2012-08-09 13:11:05 UTC
The patch does what it says. But there are 2 typos:

Two consecutive <b> tags here:
[% ELSIF ( filerror.OPNERR ) %]<b><b>ERROR:</b>

and a remaining WARNING here (one <b> tag should be removed also):
[% ELSE %]<b>WARNING:<b>ERROR:</b>
Comment 3 Marc Véron 2012-08-10 03:57:26 UTC Comment hidden (obsolete)
Comment 4 Marc Véron 2012-08-10 04:23:18 UTC Comment hidden (obsolete)
Comment 5 Julian Maurice 2012-08-10 06:22:44 UTC
Created attachment 11523 [details] [review]
[SIGNED-OFF] Bug 8573 - Translation difficult in picture-upload.tt due to nested sentence in if/foreach/if/elsif - construction

Text could not be correctly translated due to poor parsing of nested sentences in Pootle.

*Sentences de-nested to have whole sentence in each if /elsif branch
*Cleaned up <li></li> handling: moved closing </li> outside the for each loop to prevent orphaned closing </li>s.
*Changed indentation for better readibility
*Changed WARNING to ERROR because it is an *Error* during upload.
*Wording simplified (for translation).
*In one case added hint to refer to online help (size).

This way text should be easier to be translated in Pootle.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 6 Mason James 2012-08-10 07:05:42 UTC
(In reply to comment #5)
> Created attachment 11523 [details] [review]
> [SIGNED-OFF] Bug 8573 - Translation difficult in picture-upload.tt due to
> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

patch looks good, passing QA

mason@xen1:~/git/head$ koha-qa.pl
        * 5475444 Bug 8573 - Translation difficult in picture-upload.tt due to nested sentence in if/foreach/if/elsif - construction
                koha-tmpl/intranet-tmpl/prog/en/modules/tools/picture-upload.tt

- perlcritic-progressive tests... OK
- perl -c syntax tests... OK
- xt/tt_valid.t tests... OK
- xt/author/valid-template.t tests... OK
Comment 7 Chris Cormack 2012-08-12 06:05:51 UTC
Pushed to 3.8.x, will be in 3.8.4
Comment 8 Paul Poulain 2012-08-31 20:50:34 UTC
Patch pushed to master