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.
Created attachment 11375 [details] [review] 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 *Changed WARNING to ERROR because it is an *Error* during upload. *Wording simplified. In one case added hint to refer to online help (size). This way text should be easier to be translated in Pootle.
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>
Created attachment 11517 [details] [review] 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. *Chanched 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.
Created attachment 11518 [details] [review] 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.
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>
(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
Pushed to 3.8.x, will be in 3.8.4
Patch pushed to master