Bug 38684: Improve translatability in cat-toolbar.inc

This patch converts strings using

* *subscription(s)*
* *item(s)*

into different strings for the singular and plural forms. This helps
translating and is also more accurate for the end user.

To test:
1. Have a record with 2 items and 2 subscriptions
2. hover on the _Edit > Delete record_  dropdown item
   => FAIL: Mixed form string about items
3. Delete one item at a time, repeating 2
   => FAIL: Mixed form string at each step
4. Once items are deleted, repeat 2
   => FAIL: Mixed form string about subscriptions
5. Delete one subscription at a time, repeating 2
   => FAIL: Mixed form string at each step
6. Apply this patch
7. Repeat 1-5
   => SUCCESS: Different message in singular and plural forms
   => SUCCESS: The message is correct
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 03392b660e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Tomas Cohen Arazi 2024-12-12 08:25:41 -03:00 committed by Paul Derscheid
parent 65401fbbb8
commit ae9b983130
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 3 additions and 2 deletions

View File

@ -130,11 +130,12 @@
[% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
[% IF ( count ) %]
<li data-bs-toggle="tooltip" data-bs-placement="left" title="[% count | html %] item(s) are attached to this record. You must delete all items before deleting this record">
<li data-bs-toggle="tooltip" data-bs-placement="left" title="[%- I18N.tnx("There is an item attached to this record", "There are {count} items attached to this record", count, { count => count }) -%]. You must delete all items before deleting this record">
<a class="dropdown-item disabled" aria-disabled="true" id="deletebiblio" href="#">Delete record</a>
</li>
[% ELSIF ( biblio.subscriptions.count ) %]
<li data-bs-toggle="tooltip" data-bs-placement="left" title="[% biblio.subscriptions.count | html %] subscription(s) are attached to this record. You must delete all subscriptions before deleting this record">
[%- SET subscriptions_count = biblio.subscriptions.count -%]
<li data-bs-toggle="tooltip" data-bs-placement="left" title="[%- I18N.tnx("There is a subscription attached to this record", "There are {count} subscriptions attached to this record", subscriptions_count, { count => subscriptions_count }) -%]. You must delete all subscriptions before deleting this record">
<a class="dropdown-item disabled" aria-disabled="true" id="deletebiblio" href="#">Delete record</a>
</li>
[% ELSE %]