Bug 36872 - Untranslatable "Please make sure all selected titles have a pickup location set"
Summary: Untranslatable "Please make sure all selected titles have a pickup location set"
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 28273
Blocks:
  Show dependency treegraph
 
Reported: 2024-05-15 18:56 UTC by Caroline Cyr La Rose
Modified: 2024-05-31 13:26 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:
24.05.00,23.11.06,23.05.12


Attachments
Bug 36872: Untranslatable strings in request.tt (2.16 KB, patch)
2024-05-16 13:09 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36872: Untranslatable strings in request.tt (2.23 KB, patch)
2024-05-16 13:54 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 36872: Untranslatable strings in request.tt (2.33 KB, patch)
2024-05-17 09:53 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2024-05-15 18:56:24 UTC
When placing a multi-hold, the error message that appears if you don't select a pickup library is untranslatable.

To recreate the message:
1. In the staff interface, search the catalog with a term that will return a couple of items (e.g. Shakespeare)
2. In the search results, select two or more results
3. Click Place hold
4. Search for a patron (e.g. Acevedo)
5. Click Place holds
   --> Error "Please make sure all selected titles have a pickup location set" 

To get po files:

ktd --shell

cd misc/translator/po

gulp po:update --lang fr-CA

git grep "Please make sure all"
--> Returns nothing
Comment 1 Owen Leonard 2024-05-16 13:09:12 UTC
Created attachment 166826 [details] [review]
Bug 36872: Untranslatable strings in request.tt

There are errors in the JavaScript in the holds template in the staff
client which results in strings not being translatable. This patch
corrects the errors.

To test, apply the patch and run through the process of placing a hold
on multiple items in the staff interface.

- At the hold confirmation step, try to submit the form without
  selecting pickup locations for one or more titles.
- You should get an alert, "Please make sure all selected titles have a
  pickup location set".
- Uncheck the checkboxes next to each title you're placing a hold on.
- Submit the form. You should get an error: "Please select at least one
  title".

- Test the translation process with a language, e.g. fr-FR:
- In KTD, run: gulp po:update --lang fr-FR
- Check fr-FR-staff-prog.po for the line referring to
  koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:1499
- You should see the string "Please make sure all selected titles have a
  pickup location set".
Comment 2 Caroline Cyr La Rose 2024-05-16 13:54:25 UTC
Created attachment 166827 [details] [review]
Bug 36872: Untranslatable strings in request.tt

There are errors in the JavaScript in the holds template in the staff
client which results in strings not being translatable. This patch
corrects the errors.

To test, apply the patch and run through the process of placing a hold
on multiple items in the staff interface.

- At the hold confirmation step, try to submit the form without
  selecting pickup locations for one or more titles.
- You should get an alert, "Please make sure all selected titles have a
  pickup location set".
- Uncheck the checkboxes next to each title you're placing a hold on.
- Submit the form. You should get an error: "Please select at least one
  title".

- Test the translation process with a language, e.g. fr-FR:
- In KTD, run: gulp po:update --lang fr-FR
- Check fr-FR-staff-prog.po for the line referring to
  koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:1499
- You should see the string "Please make sure all selected titles have a
  pickup location set".

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 3 Caroline Cyr La Rose 2024-05-16 13:54:39 UTC
Thanks Owen!
Comment 4 Marcel de Rooy 2024-05-17 09:53:17 UTC
Created attachment 166881 [details] [review]
Bug 36872: Untranslatable strings in request.tt

There are errors in the JavaScript in the holds template in the staff
client which results in strings not being translatable. This patch
corrects the errors.

To test, apply the patch and run through the process of placing a hold
on multiple items in the staff interface.

- At the hold confirmation step, try to submit the form without
  selecting pickup locations for one or more titles.
- You should get an alert, "Please make sure all selected titles have a
  pickup location set".
- Uncheck the checkboxes next to each title you're placing a hold on.
- Submit the form. You should get an error: "Please select at least one
  title".

- Test the translation process with a language, e.g. fr-FR:
- In KTD, run: gulp po:update --lang fr-FR
- Check fr-FR-staff-prog.po for the line referring to
  koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:1499
- You should see the string "Please make sure all selected titles have a
  pickup location set".

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Katrin Fischer 2024-05-17 10:05:06 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 6 Jonathan Druart 2024-05-20 13:04:36 UTC
Are those \n needed at all?
Comment 7 Fridolin Somers 2024-05-29 13:29:23 UTC
Looks like this is since Bug 28273

And there are other places :
 > git grep '" + "\\n"' origin/main 
origin/main:koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:                        msg = _("- Please select a pickup location for the item" + "\n")
origin/main:koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:                        msg = _("- Please select a pickup location for this hold" + "\n");
origin/main:koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:                    msg = _("- Please select a pickup location for this hold" + "\n");
Comment 8 Lucas Gass 2024-05-31 13:09:32 UTC
Backported to 23.05.x for upcoming 23.05.12
Comment 9 Lucas Gass 2024-05-31 13:10:15 UTC
(In reply to Fridolin Somers from comment #7)
> Looks like this is since Bug 28273
> 
> And there are other places :
>  > git grep '" + "\\n"' origin/main 
> origin/main:koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:     
> msg = _("- Please select a pickup location for the item" + "\n")
> origin/main:koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:     
> msg = _("- Please select a pickup location for this hold" + "\n");
> origin/main:koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:     
> msg = _("- Please select a pickup location for this hold" + "\n");

Fridolin, do we need to open a follow-up bug?
Comment 10 Katrin Fischer 2024-05-31 13:26:09 UTC
(In reply to Lucas Gass from comment #9)
> (In reply to Fridolin Somers from comment #7)
> > Looks like this is since Bug 28273
> > 
> > And there are other places :
> >  > git grep '" + "\\n"' origin/main 
> > origin/main:koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:     
> > msg = _("- Please select a pickup location for the item" + "\n")
> > origin/main:koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:     
> > msg = _("- Please select a pickup location for this hold" + "\n");
> > origin/main:koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:     
> > msg = _("- Please select a pickup location for this hold" + "\n");
> 
> Fridolin, do we need to open a follow-up bug?

Yes, I think it would be good.