Bug 10049 - Comments tab shows ( ) instead of ( 0 ) on translated templates
Summary: Comments tab shows ( ) instead of ( 0 ) on translated templates
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Katrin Fischer
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-14 17:45 UTC by Katrin Fischer
Modified: 2014-05-26 21:04 UTC (History)
1 user (show)

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


Attachments
screenshot (7.37 KB, image/png)
2013-04-14 17:45 UTC, Katrin Fischer
Details
Bug 10049: Comments tab shows ( ) instad of ( 0 ) for translated templates (1.48 KB, patch)
2013-04-14 17:55 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 10049 [Alternate] Comments tab shows ( ) instead of ( 0 ) on translated templates (1.76 KB, patch)
2013-04-15 13:45 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 10049 [Alternate] Comments tab shows ( ) instead of ( 0 ) on translated templates (2.20 KB, patch)
2013-04-17 10:24 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 10049 [Alternate] Comments tab shows ( ) instead of ( 0 ) on translated templates (2.25 KB, patch)
2013-04-19 13:12 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2013-04-14 17:45:05 UTC
Created attachment 17423 [details]
screenshot

To reproduce:

1) Make sure comments/reviews are activated
2) Find a record with 0 comments/reviews in the opac
3) The tab shows: Comments ( 0 )
4) Switch to any other languages.
5) Tab now shows: <translation of Comments> ( )
Comment 1 Katrin Fischer 2013-04-14 17:55:07 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2013-04-15 13:45:38 UTC Comment hidden (obsolete)
Comment 3 Magnus Enger 2013-04-17 10:24:34 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2013-04-19 13:12:28 UTC
QA comment:
Same as Magnus here, translate install is not enough but update + translation + install works !
Marked as Passed QA.
Comment 5 Jonathan Druart 2013-04-19 13:12:36 UTC
Created attachment 17544 [details] [review]
Bug 10049 [Alternate] Comments tab shows ( ) instead of ( 0 ) on translated templates

This patch is an alternate solution to the problem of "0" not appearing
on the comment tab in translated templates. It uses the Template Toolkit
option of specifying a default value for a variable:

[% reviews.size || 0 %]

This syntax is already in use elsewhere in the template.

Same test plan:

1) Make sure comments/reviews are activated
2) Find a record with 0 comments/reviews in the opac
3) The tab shows: Comments ( 0 )
4) Switch to any other languages.
5) Tab now shows: <translation of Comments> ( )
6) Apply patch
7) Check English templates stil work correctly
8) Rerun 'perl translate install <langcode>
9) Check display is now correct.
10) Also check that number shows correctly for records
    with comments.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Tested with nb-NO. English still works after the patch. Norwegian
was showing "Comments" untranslated, which had me a bit unnerved.
Turns out the string to be translated changed from "Comments ( %s%s%s%s )"
to "Comments ( %s )", so to make sure all was well, I had to update
the nb-NO translation, fix the number of %s's in the Norwegian string,
make sure it was not marked as fuzzy and then install nb-NO. And it
works!

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 6 Jared Camins-Esakov 2013-04-21 14:01:00 UTC
This patch has been pushed to master and 3.12.x.