Bug 31563 - Numbers on claims tab not showing in translated templates
Summary: Numbers on claims tab not showing in translated templates
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-14 13:19 UTC by Katrin Fischer
Modified: 2023-12-28 20:42 UTC (History)
6 users (show)

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


Attachments
Screenshot of German interface (4.58 KB, image/png)
2022-09-14 13:20 UTC, Katrin Fischer
Details
Bug 31563: Make zero claims show correctly for translations (3.84 KB, patch)
2023-02-09 23:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31563: Make zero claims show correctly for translations (3.91 KB, patch)
2023-02-10 20:39 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 31563: Make zero claims show correctly for translations (3.91 KB, patch)
2023-02-22 15:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 31563: Make zero claims show correctly for translations (3.99 KB, patch)
2023-02-23 10:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 31563: (follow-up) Add missing TT filters (3.09 KB, patch)
2023-02-24 21:49 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2022-09-14 13:19:41 UTC
When looking at the patron account details or checkouts tab in the staff interface, the tab Claims is missing the numbers in translated templates.

Verified on master for German and Greek.

I had filed bug 26561 about this a while ago, but the issue reappered and I don't see how to fix it in the po files. Also we have a second language where it's broken now. I wonder if it's the problem with 0 in templates showing here again.
Comment 1 Katrin Fischer 2022-09-14 13:20:28 UTC
Created attachment 140631 [details]
Screenshot of German interface
Comment 2 Katrin Fischer 2023-02-09 23:21:53 UTC
This shows that the 0 are lost in the translation process:

English:
<li role="presentation">
                                    
                                        <a href="#return-claims" id="return-claims-tab" aria-controls="return-claims" role="tab" data-toggle="tab">
                                            Claims
                                            (<span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">0</span>
                                            <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">0</span>)
                                        </a>
                                    
                                </li>

French:
<li role="presentation">
 
 <a href="#return-claims" id="return-claims-tab" aria-controls="return-claims" role="tab" data-toggle="tab">
 Réclamations (<span class="label label-default" id="return-claims-count-resolved" title="Réclamations résolues"></span>)
 
 <span class="label label-default" id="return-claims-count-unresolved" title="Réclamations non résolues"></span></a>
 
 </li>
Comment 3 Katrin Fischer 2023-02-09 23:33:50 UTC
Created attachment 146462 [details] [review]
Bug 31563: Make zero claims show correctly for translations

A tag that only contains 0 is turned into an empty tag by
the translation scripts. This turns "Claims ( 0 0 )" into
"Claims (   )" in translated templates.

To test:
* Install an additional language (fr-FR, es-ES) and activate
  it in the system preferences
* Look at the checkouts and details tabs in any patron account
  in the staff interface
* Verify the claims tab shows without the zeros as described above
* Apply the patch
* Update the translation so the templates are recreated with the change
* Verify that the 0 0 now show correctly.
Comment 4 Caroline Cyr La Rose 2023-02-10 20:39:24 UTC
Created attachment 146518 [details] [review]
Bug 31563: Make zero claims show correctly for translations

A tag that only contains 0 is turned into an empty tag by
the translation scripts. This turns "Claims ( 0 0 )" into
"Claims (   )" in translated templates.

To test:
* Install an additional language (fr-FR, es-ES) and activate
  it in the system preferences
* Look at the checkouts and details tabs in any patron account
  in the staff interface
* Verify the claims tab shows without the zeros as described above
* Apply the patch
* Update the translation so the templates are recreated with the change
* Verify that the 0 0 now show correctly.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 5 Caroline Cyr La Rose 2023-02-10 20:42:06 UTC
Works perfectly, thanks Katrin!

I hadn't noticed, but it goes as least as far as 22.05.
Comment 6 Katrin Fischer 2023-02-10 20:43:03 UTC
(In reply to Caroline Cyr La Rose from comment #5)
> Works perfectly, thanks Katrin!
> 
> I hadn't noticed, but it goes as least as far as 22.05.

Thanks to you!
Comment 7 Jonathan Druart 2023-02-22 15:50:10 UTC
Created attachment 147170 [details] [review]
Bug 31563: Make zero claims show correctly for translations

A tag that only contains 0 is turned into an empty tag by
the translation scripts. This turns "Claims ( 0 0 )" into
"Claims (   )" in translated templates.

To test:
* Install an additional language (fr-FR, es-ES) and activate
  it in the system preferences
* Look at the checkouts and details tabs in any patron account
  in the staff interface
* Verify the claims tab shows without the zeros as described above
* Apply the patch
* Update the translation so the templates are recreated with the change
* Verify that the 0 0 now show correctly.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 8 Jonathan Druart 2023-02-22 15:50:27 UTC
That's definitely a bug in the translation script, but I am lazy to dig into it now.
Comment 9 Jonathan Druart 2023-02-23 10:50:58 UTC
Created attachment 147223 [details] [review]
Bug 31563: Make zero claims show correctly for translations

A tag that only contains 0 is turned into an empty tag by
the translation scripts. This turns "Claims ( 0 0 )" into
"Claims (   )" in translated templates.

To test:
* Install an additional language (fr-FR, es-ES) and activate
  it in the system preferences
* Look at the checkouts and details tabs in any patron account
  in the staff interface
* Verify the claims tab shows without the zeros as described above
* Apply the patch
* Update the translation so the templates are recreated with the change
* Verify that the 0 0 now show correctly.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Tomás Cohen Arazi 2023-02-24 19:56:23 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 11 Katrin Fischer 2023-02-24 21:46:30 UTC
Looks like I broke jenkins. Providing a follow up for missing filters.
Comment 12 Katrin Fischer 2023-02-24 21:49:12 UTC
Created attachment 147409 [details] [review]
Bug 31563: (follow-up) Add missing TT filters
Comment 13 Tomás Cohen Arazi 2023-02-27 11:39:37 UTC
Follow-up pushed to master.

I noticed this, but didn't know it would break the tests. It is obviously a false negative as we are setting the variable a couple lines above and doesn't need the filter.
Comment 14 Jonathan Druart 2023-02-28 07:56:31 UTC
(In reply to Tomás Cohen Arazi from comment #13)
> Follow-up pushed to master.
> 
> I noticed this, but didn't know it would break the tests. It is obviously a
> false negative as we are setting the variable a couple lines above and
> doesn't need the filter.

All variables displayed must be filtered. There is no false negative here.
Comment 15 Matt Blenkinsop 2023-02-28 16:34:20 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 16 Matt Blenkinsop 2023-02-28 18:00:31 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 17 Matt Blenkinsop 2023-02-28 18:02:27 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 18 Lucas Gass 2023-03-08 13:25:57 UTC
Doesn't apply clean in 22.05.x, no backport. If needed please rebase.