Bugzilla – Attachment 123338 Details for
Bug 26979
Show correctly-pluralized labels on checkouts page tabs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26979: Show correctly-pluralized labels on checkouts page tabs
Bug-26979-Show-correctly-pluralized-labels-on-chec.patch (text/plain), 15.39 KB, created by
Owen Leonard
on 2021-07-30 18:16:08 UTC
(
hide
)
Description:
Bug 26979: Show correctly-pluralized labels on checkouts page tabs
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-07-30 18:16:08 UTC
Size:
15.39 KB
patch
obsolete
>From b6862f8d972b777ada5500850e1784608f137f00 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Sat, 22 Aug 2020 13:01:51 +0000 >Subject: [PATCH] Bug 26979: Show correctly-pluralized labels on checkouts page > tabs > >This patch modifies the tabs shown on the checkout and patron detail >page so that counts of checkouts, etc. have the correct pluralization. >This avoids the use of labels like "Checkout(s)" > >To test, apply the patch and check out to a patron. > >- The tabs showing checkouts, holds, claims, etc. should show the > correct plural or singular on each label, e.g.: > > 14 Checkouts > 20 Holds > 0 Article requests > 1 Club > >- Test that each plural/singular changes appropriately when you add > checkouts, holds, clubs, etc. > >To test translation, apply the patch and test that the correct strings >are translatable. In this example I'm testing fr-FR: > >- Update a translation: > > > gulp po:update > > cd misc/translator > > perl translate update fr-FR > >- Open the corresponding .po file for the strings pulled from > the templates e.g. misc/translator/po/fr-FR-messages.po >- Locate strings pulled from circulation.tt and moremember.tt > translation, e.g.: > > #: koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt:770 > msgid "Relatives' checkout" > msgid_plural "Relatives' checkouts" > msgstr[0] "" > msgstr[1] "" > >- Edit the "msgstr[0]" and "msgstr[1]" strings however you want (it's > just for testing) >- Install the updated translation: > > > perl translate install fr-FR > >In the staff client, switch to the language you're testing. Confirm that >your translated strings appear correctly in singular and plural cases. >--- > .../prog/en/modules/circ/circulation.tt | 51 ++++++---------- > .../prog/en/modules/members/moremember.tt | 59 ++++++++----------- > 2 files changed, 41 insertions(+), 69 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 1771a941f0..cc764595d6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -8,6 +8,7 @@ > [% USE ItemTypes %] > [% USE Price %] > [% USE AuthorisedValues %] >+[% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > [% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %] >@@ -761,65 +762,49 @@ > <div id="patronlists" class="toptabs"> > <ul> > <li> >- [% IF ( issuecount ) %] >- <a href="#checkouts">[% issuecount | html %] Checkout(s)</a> >- [% ELSE %] >- <a href="#checkouts">0 Checkouts</a> >- [% END %] >+ <a href="#checkouts">[% issuecount | html %] [% tn('Checkout', 'Checkouts', issuecount) | $raw %]</a> > </li> > > [% IF relatives_issues_count %] >- <li><a id="relatives-issues-tab" href="#relatives-issues">[% relatives_issues_count | html %] Relatives' checkouts</a></li> >+ <li> >+ <a id="relatives-issues-tab" href="#relatives-issues">[% relatives_issues_count | html %] [% tn("Relatives' checkout", "Relatives' checkouts", relatives_issues_count) | $raw %]</a> >+ </li> > [% END %] > > <li> >- [% IF ( holds_count ) %] >- <a href="#reserves" id="holds-tab">[% holds_count | html %] Hold(s)</a> >- [% ELSE %] >- <a href="#reserves" id="holds-tab">0 Holds</a> >- [% END %] >+ <a href="#reserves" id="holds-tab">[% holds_count | html %] [% tn('Hold', 'Holds', holds_count) | $raw %]</a> > </li> > > [% IF Koha.Preference('ArticleRequests') %] > <li> >- <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count | html %] Article requests</a> >+ <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count | html %] [% tn('Article request', 'Article requests', patron.article_requests_current.count) | $raw %]</a> > </li> > [% END %] > > [% IF Koha.Preference('ClaimReturnedLostValue') %] > <li> >- [% IF ( patron.return_claims.count ) %] >- <a href="#return-claims" id="return-claims-tab"> >- Claim(s) >- [% IF patron.return_claims.resolved.count == 0 %] >- <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span> >- [% ELSE %] >- <span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span> >- [% END %] >- [% IF patron.return_claims.unresolved.count == 0 %] >- <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span> >- [% ELSE %] >- <span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span> >- [% END %] >- </a> >- [% ELSE %] > <a href="#return-claims" id="return-claims-tab"> >- Claim(s) >- <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> >+ [% patron.return_claims.unresolved.count | html %] [% tn('Claim', 'Claims', patron.return_claims.unresolved.count) | $raw %] > </a> >- [% END %] > </li> > [% END %] > >- <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.count | html %] Restrictions</a></li> >+ <li> >+ <a id="debarments-tab-link" href="#reldebarments"> >+ [% IF ( debarments.size > 0 ) %] >+ [% debarments.size | html %] [% tn('Restriction', 'Restrictions', debarments.size) | $raw %] >+ [% ELSE %] >+ 0 Restrictions >+ [% END %] >+ </a> >+ </li> > > [% SET enrollments = patron.get_club_enrollments(1) %] > [% SET enrollable = patron.get_enrollable_clubs(0,1) %] > [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %] > <li> > <a id="clubs-tab-link" href="#clubs-tab"> >- Clubs ([% enrollments.count | html %]/[% enrollable.count | html %]) >+ [% enrollments.count | html %] [% tn('Club', 'Clubs', enrollments.count) | $raw %] > </a> > </li> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 42cbbe0ee9..9f04e916bf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -7,6 +7,7 @@ > [% USE AuthorisedValues %] > [% USE TablesSettings %] > [% USE Price %] >+[% PROCESS 'i18n.inc' %] > [% PROCESS 'member-display-address-style.inc' %] > [% PROCESS 'member-display-alt-address-style.inc' %] > [% SET footerjs = 1 %] >@@ -673,69 +674,55 @@ > <div id="finesholdsissues" class="toptabs"> > <ul> > <li> >- <a href="#checkouts">[% issuecount | html %] Checkout(s)</a> >+ <a href="#checkouts">[% issuecount | html %] [% tn('Checkout', 'Checkouts', issuecount) | $raw %]</a> > </li> >+ > [% IF relatives_issues_count %] > <li> >- <a href="#relatives-issues" id="relatives-issues-tab">[% relatives_issues_count | html %] Relatives' checkouts</a> >+ <a id="relatives-issues-tab" href="#relatives-issues">[% relatives_issues_count | html %] [% tn("Relatives' checkout", "Relatives' checkouts", relatives_issues_count) | $raw %]</a> > </li> > [% END %] >+ > [% IF ( fines ) %] > <li id="finestab"> > <a href="#finesandcharges">Charges ([% fines | $Price %])</a> > </li> > [% END %] >- [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %] >- <li> >- [% IF ( holds_count ) %] >- <a href="#reserves" id="holds-tab">[% holds_count | html %] Hold(s)</a> >- [% ELSE %] >- <a href="#reserves" id="holds-tab">0 Holds</a> >- [% END %] >- </li> >- [% END %] >+ >+ <li> >+ <a href="#reserves" id="holds-tab">[% holds_count | html %] [% tn('Hold', 'Holds', holds_count) | $raw %]</a> >+ </li> >+ > [% IF Koha.Preference('ArticleRequests') %] > <li> >- <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count | html %] Article requests</a> >+ <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count | html %] [% tn('Article request', 'Article requests', patron.article_requests_current.count) | $raw %]</a> > </li> > [% END %] > > [% IF Koha.Preference('ClaimReturnedLostValue') %] > <li> >- [% IF ( patron.return_claims.count ) %] >- <a href="#return-claims" id="return-claims-tab"> >- Claim(s) >- [% IF patron.return_claims.resolved.count == 0 %] >- <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span> >- [% ELSE %] >- <span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span> >- [% END %] >- [% IF patron.return_claims.unresolved.count == 0 %] >- <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span> >- [% ELSE %] >- <span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span> >- [% END %] >- >- </a> >- [% ELSE %] >- <a href="#return-claims" id="return-claims-tab"> >- Claim(s) >- <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> >- [% END %] >+ <a href="#return-claims" id="return-claims-tab"> >+ [% patron.return_claims.unresolved.count | html %] [% tn('Claim', 'Claims', patron.return_claims.unresolved.count) | $raw %] >+ </a> > </li> > [% END %] > > <li> >- <a id="debarments-tab-link" href="#reldebarments">[% debarments.size | html %] Restrictions</a> >+ <a id="debarments-tab-link" href="#reldebarments"> >+ [% IF ( debarments.size > 0 ) %] >+ [% debarments.size | html %] [% tn('Restriction', 'Restrictions', debarments.size) | $raw %] >+ [% ELSE %] >+ 0 Restrictions >+ [% END %] >+ </a> > </li> >+ > [% SET enrollments = patron.get_club_enrollments(1) %] > [% SET enrollable = patron.get_enrollable_clubs(0,1) %] > [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %] > <li> > <a id="clubs-tab-link" href="#clubs-tab"> >- Clubs ([% enrollments.count | html %]/[% enrollable.count | html %]) >+ [% enrollments.count | html %] [% tn('Club', 'Clubs', enrollments.count) | $raw %] > </a> > </li> > [% END %] >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26979
:
123338
|
123350
|
123932