Bug 7478 - Template/translation problem in catalogue_out.tt
Summary: Template/translation problem in catalogue_out.tt
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact:
Depends on: 8215
  Show dependency treegraph
Reported: 2012-01-31 07:29 UTC by Katrin Fischer
Modified: 2014-05-26 21:04 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:

Bug 7478 - Template/translation problem in catalogue_out.tt (3.50 KB, patch)
2013-08-09 15:20 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED OFF] Bug 7478 - Template/translation problem in catalogue_out.tt (3.56 KB, patch)
2013-08-25 18:50 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 7478 - Template/translation problem in catalogue_out.tt (3.60 KB, patch)
2013-08-28 11:24 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2012-01-31 07:29:35 UTC
Spotted while working on a translation bug, reporting so that it does not get lost:


[% IF ( looptable.looprow ) %]
[% FOREACH loopro IN looptable.looprow %]
loopro.itemcallnumber="No Call Number"
loopro.barcode="No Barcode"
loopro.title="NO TITLE"
[% UNLESS ( loop.odd ) %]<tr class="highlight">
[% ELSE %]<tr>[% END %]

staff po file:

%s %s [%% DEFAULT loopro.itemcallnumber=\"No Call Number\" loopro.barcode=\"No Barcode\" loopro.title=\"NO TITLE\" loopro.author=\"\" %%] %s

That will not work if translated like that.

It also seems like " are escaped in the po files now, which does not seem right to me. There are other examples, that will break things if copied over with espcaped double quotes.
Comment 1 Owen Leonard 2013-08-09 15:20:02 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2013-08-25 18:50:42 UTC Comment hidden (obsolete)
Comment 3 Chris Cormack 2013-08-28 11:24:17 UTC
Created attachment 20701 [details] [review]
Bug 7478 - Template/translation problem in catalogue_out.tt

The items with no checkouts template has a sections that uses DEFAULT to
set some strings: [% DEFAULT loopro.itemcallnumber="No Call Number" %]
This appears to be untranslatable with our current translation tool.

This patch changes the template so that it uses a simple [% IF %] block
to display the default text if no value is set. Added is use of the
Branches template plugin to show library name instead of code.

This patch also fixes an error introduced in my fix for Bug 8124 causing
the page to default to CSV download instead of output to screen.

To test, apply the patch and confirm that the default text appears
onscreen in reports which include results that have a missing barcode,
title, or call number. Results should be displayed on screen correctly.

Run "perl translate update" for any language and confirm that the newly
generated po file includes "No call number," "No barcode," and "NO
TITLE" for catalogue_out.tt

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, thx Owen!

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 4 Galen Charlton 2013-09-08 05:16:43 UTC
Pushed to master.  Thanks, Owen!
Comment 5 Tomás Cohen Arazi 2013-10-31 15:07:16 UTC
This patch has been pushed to 3.12.x, will be in 3.12.7.

Thanks Owen!