At the moment the dashboard panel on the OPAC start page uses "checkout(s)", "overdue(s)", "hold(s)" etc. We have the tools now to deal with these in a nicer way, showing "1 hold" and "2 holds" and deal with these nicely in translations as well. For documentation see: https://wiki.koha-community.org/wiki/Internationalization,_plural_forms,_context,_and_more_RFC For an example see the result list on the staff side: https://git.koha-community.org/Koha-community/Koha/src/branch/master/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt#L535 [% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %]
Why not use something like the following instead? Checkouts: [% checkouts.count %] Overdues: [% overdues.count %] Holds: [% holds.count %]
We could, but are we sure that this is nice in every language? I think using the singular/plural feature in such a prominent place would make sense and look good :)
(In reply to Katrin Fischer from comment #2) > We could, but are we sure that this is nice in every language? I think using > the singular/plural feature in such a prominent place would make sense and > look good :) I disagree about the singular/plural feature but that's OK. As for appropriateness for every language, I think avoiding singular/plural is more likely to be better for every language. I like the advice at https://developer.atlassian.com/server/framework/atlassian-sdk/pluralising-internationalisation-strings/ Considering that Atlassian has about 10 million active users of its products internationally in 190+ countries (https://www.atlassian.com/customers), I think it would be wise to listen to their advice. But that's just my 2 cents and I know I'm in the minority in this view. I figured I'd just reiterate it anyway.
Created attachment 114899 [details] [review] Bug 27325: Fix singular/plural forms on the OPAC dashboard This patch adds handling of plurals to the display of counts on the logged-in user's dashboard: checkouts, overdues, etc. To test, apply the patch and log in to the OPAC. - Go to the OPAC main page and check the user dashboard area. - Confirm that the correct numbers and plural forms are shown for checkouts, overdues, holds pending, holds waiting, and messages. - Test each of those categories with counts of 0, 1, and more than one to confirm that the plural forms are correct. - Test with various counts of each type of message: OPAC notes as defined when editing a patron record and notes added via the checkout page.
This works good and it looks good. I think this is much cleaner looking than the with the (s). The plural and singular forms all work well for checkouts, overdues, holds pending, holds waiting, and messages. The template is missing some filters though: FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt FAIL filters missing_filter at line 225 ( [% tn('checkout', 'checkouts', checkouts ) %]) missing_filter at line 233 ( [% tn('overdue', 'overdues', overdues ) %]) missing_filter at line 241 ( [% tn('hold pending', 'holds pending', holds_pending ) %]) missing_filter at line 249 ( [% tn('hold waiting', 'holds waiting', holds_waiting ) %]) missing_filter at line 266 ( [% tn('message', 'messages', patron_messages.count + 1 ) %]) missing_filter at line 273 ( [% tn('message', 'messages', patron_messages.count ) %])
Created attachment 115015 [details] [review] Bug 27325: Fix singular/plural forms on the OPAC dashboard This patch adds handling of plurals to the display of counts on the logged-in user's dashboard: checkouts, overdues, etc. To test, apply the patch and log in to the OPAC. - Go to the OPAC main page and check the user dashboard area. - Confirm that the correct numbers and plural forms are shown for checkouts, overdues, holds pending, holds waiting, and messages. - Test each of those categories with counts of 0, 1, and more than one to confirm that the plural forms are correct. - Test with various counts of each type of message: OPAC notes as defined when editing a patron record and notes added via the checkout page.
Created attachment 115037 [details] [review] Bug 27325: Fix singular/plural forms on the OPAC dashboard This patch adds handling of plurals to the display of counts on the logged-in user's dashboard: checkouts, overdues, etc. To test, apply the patch and log in to the OPAC. - Go to the OPAC main page and check the user dashboard area. - Confirm that the correct numbers and plural forms are shown for checkouts, overdues, holds pending, holds waiting, and messages. - Test each of those categories with counts of 0, 1, and more than one to confirm that the plural forms are correct. - Test with various counts of each type of message: OPAC notes as defined when editing a patron record and notes added via the checkout page. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 115102 [details] [review] Bug 27325: Fix singular/plural forms on the OPAC dashboard This patch adds handling of plurals to the display of counts on the logged-in user's dashboard: checkouts, overdues, etc. To test, apply the patch and log in to the OPAC. - Go to the OPAC main page and check the user dashboard area. - Confirm that the correct numbers and plural forms are shown for checkouts, overdues, holds pending, holds waiting, and messages. - Test each of those categories with counts of 0, 1, and more than one to confirm that the plural forms are correct. - Test with various counts of each type of message: OPAC notes as defined when editing a patron record and notes added via the checkout page. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 21.05, thanks to everybody involved!
Depends on Bug 26123 not in 20.11.x