Bug 20166 - Untranslatable course reserves delete prompt
Summary: Untranslatable course reserves delete prompt
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: paxed
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-09 07:16 UTC by paxed
Modified: 2019-10-14 19:56 UTC (History)
3 users (show)

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


Attachments
Bug 20166: Untranslatable course reserves delete prompt (2.87 KB, patch)
2018-02-09 07:17 UTC, paxed
Details | Diff | Splinter Review
Bug 20166: Untranslatable course reserves delete prompt (2.91 KB, patch)
2018-02-09 19:52 UTC, Roch D'Amour
Details | Diff | Splinter Review
Bug 20166: Untranslatable course reserves delete prompt (2.91 KB, patch)
2018-02-11 15:30 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 paxed 2018-02-09 07:16:41 UTC
Having a Template Toolkit statements inside the javascript translation function _() prevents it from being picked for translation.

The only example of such is the course reserve delete prompt.

To see if there are other such TT statements:
    
    rgrep -E '\b_\("[^"]*\[%' koha-tmpl/
Comment 1 paxed 2018-02-09 07:17:55 UTC
Created attachment 71364 [details] [review]
Bug 20166: Untranslatable course reserves delete prompt

Having a Template Toolkit statements inside the javascript
translation function _() prevents it from being picked for
translation.

The only example of such is the course reserve delete prompt.
Move the TT statement outside the string.

Test plan:

1) Update and install language xx-YY. Check that the msgids
   "Are you sure you want to delete this course? There is %s attached item."
   and
   "Are you sure you want to delete this course? There are %s attached items."
   do not exist in the xx-YY-staff-prog.po
2) Check the translated file
   intranet-tmpl/prog/fi-FI/modules/course_reserves/course-details.tt
   It should have two prompt texts above in English
3) Install patch
4) Update the language. Check that the msgids show up in
   xx-YY-staff-prog.po, translate them, and install the language.
5) Repeat 2, the prompts should now show up in the correct language.
6) Enable UsecourseReserves
7) Go to Home -> Course reserves
8) Create a new course, and add reserves to it
9) See the course details. Click on Delete course, the prompt
   should be correctly translated
10) Remove all but one of the reserves from the course
11) Repeat 9

To see if there are other such TT statements:

    rgrep -E '\b_\("[^"]*\[%' koha-tmpl/
Comment 2 Roch D'Amour 2018-02-09 19:52:52 UTC
Created attachment 71391 [details] [review]
Bug 20166: Untranslatable course reserves delete prompt

Having a Template Toolkit statements inside the javascript
translation function _() prevents it from being picked for
translation.

The only example of such is the course reserve delete prompt.
Move the TT statement outside the string.

Test plan:

1) Update and install language xx-YY. Check that the msgids
   "Are you sure you want to delete this course? There is %s attached item."
   and
   "Are you sure you want to delete this course? There are %s attached items."
   do not exist in the xx-YY-staff-prog.po
2) Check the translated file
   intranet-tmpl/prog/fi-FI/modules/course_reserves/course-details.tt
   It should have two prompt texts above in English
3) Install patch
4) Update the language. Check that the msgids show up in
   xx-YY-staff-prog.po, translate them, and install the language.
5) Repeat 2, the prompts should now show up in the correct language.
6) Enable UsecourseReserves
7) Go to Home -> Course reserves
8) Create a new course, and add reserves to it
9) See the course details. Click on Delete course, the prompt
   should be correctly translated
10) Remove all but one of the reserves from the course
11) Repeat 9

To see if there are other such TT statements:

    rgrep -E '\b_\("[^"]*\[%' koha-tmpl/

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
Comment 3 Katrin Fischer 2018-02-11 15:29:53 UTC
This is an improvement, but the variable in the case of 1 seems a little strange ;)
Comment 4 Katrin Fischer 2018-02-11 15:30:42 UTC
Created attachment 71404 [details] [review]
Bug 20166: Untranslatable course reserves delete prompt

Having a Template Toolkit statements inside the javascript
translation function _() prevents it from being picked for
translation.

The only example of such is the course reserve delete prompt.
Move the TT statement outside the string.

Test plan:

1) Update and install language xx-YY. Check that the msgids
   "Are you sure you want to delete this course? There is %s attached item."
   and
   "Are you sure you want to delete this course? There are %s attached items."
   do not exist in the xx-YY-staff-prog.po
2) Check the translated file
   intranet-tmpl/prog/fi-FI/modules/course_reserves/course-details.tt
   It should have two prompt texts above in English
3) Install patch
4) Update the language. Check that the msgids show up in
   xx-YY-staff-prog.po, translate them, and install the language.
5) Repeat 2, the prompts should now show up in the correct language.
6) Enable UsecourseReserves
7) Go to Home -> Course reserves
8) Create a new course, and add reserves to it
9) See the course details. Click on Delete course, the prompt
   should be correctly translated
10) Remove all but one of the reserves from the course
11) Repeat 9

To see if there are other such TT statements:

    rgrep -E '\b_\("[^"]*\[%' koha-tmpl/

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
Comment 5 Jonathan Druart 2018-02-12 21:09:10 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 6 Nick Clemens 2018-02-16 02:34:20 UTC
Awesome work all, pushed to stable for 17.11.03