[Bug 26261] New: Split calendar.inc into include file and JavaScript file
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 Bug ID: 26261 Summary: Split calendar.inc into include file and JavaScript file Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: oleonard@myacpl.org QA Contact: testopia@bugs.koha-community.org Depends on: 21156 Now that we have JavaScript internationalization there's no need to have strings defined in an include file like calendar.inc. I propose that we trim calendar.inc down to only those things which require template processing and move the rest of the JavaScript into its own JS file. This would allow us to do proper linting and allow browsers to cache the file. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21156 [Bug 21156] Internationalization: plural forms, context, and more for JS files -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 108758 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=108758&action=edit Bug 26261: Split calendar.inc into include file and JavaScript file This patch moves most of the JavaScript out of calendar.inc and into a new file, calendar.js. English strings in calendar.js are now wrapped in the double-underscore function to allow for translation. The patch shouldn't affect datepicker functionality in any way. To test, apply the patch and test the datepicker in various contexts: - Reports -> Statistics wizards -> Patrons - Date of birth "from" and "to" should be linked so that the former must come before the latter. - Patrons -> Add or edit patron - The date of birth field datepicker shouldn't allow you to pick a future year from the dropdown. - Tools -> Calendar. - Test that the calendar tool works correctly. - Test with various settings of the dateformat system preference. TESTING TRANSLATABILITY - Update a translation, e.g. fr-FR:
cd misc/translator perl translate update fr-FR
- Open the corresponding .po file for JavaScript strings, e.g. misc/translator/po/fr-FR-messages-js.po - Locate strings pulled from koha-tmpl/intranet-tmpl/prog/en/js/calendar.js for translation, e.g.: msgid "August" msgstr "" - Edit the "msgstr" string however you want (it's just for testing). - Install the updated translation:
perl translate install fr-FR
- Switch to your newly translated language in the staff client and test the datepicker again. Translated strings like days of the week and months should be correct. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #108758|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 110809 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110809&action=edit Bug 26261: Split calendar.inc into include file and JavaScript file This patch moves most of the JavaScript out of calendar.inc and into a new file, calendar.js. English strings in calendar.js are now wrapped in the double-underscore function to allow for translation. The patch shouldn't affect datepicker functionality in any way. To test, apply the patch and test the datepicker in various contexts: - Reports -> Statistics wizards -> Patrons - Date of birth "from" and "to" should be linked so that the former must come before the latter. - Patrons -> Add or edit patron - The date of birth field datepicker shouldn't allow you to pick a future year from the dropdown. - Tools -> Calendar. - Test that the calendar tool works correctly. - Test with various settings of the dateformat system preference. TESTING TRANSLATABILITY - Update a translation, e.g. fr-FR:
cd misc/translator perl translate update fr-FR
- Open the corresponding .po file for JavaScript strings, e.g. misc/translator/po/fr-FR-messages-js.po - Locate strings pulled from koha-tmpl/intranet-tmpl/prog/en/js/calendar.js for translation, e.g.: msgid "August" msgstr "" - Edit the "msgstr" string however you want (it's just for testing). - Install the updated translation:
perl translate install fr-FR
- Switch to your newly translated language in the staff client and test the datepicker again. Translated strings like days of the week and months should be correct. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- There may be something fishy going on with the changing date formats and the age calculation on the patron add/edit form. Before the patch is applied (current master) either when editing or adding, if you change the date format, refresh the patron add/edit page and change the date the age shown is not correct: 1. Date format set to mm/dd/yyyy 2. Add new patron (Patrons > New patron) 3. Make birth date 08/01/2020 (1 August 2020), age is shown as 1 month 4. Change the date format to dd/mm/yyyy 5. Add new patron (Patrons > New patron) (refresh the page as well with SHIFT refresh) 6. Make birth date 08/01/2020 (1 August 2020), age is shown as 8 months 7. Repeat from step 4 AFTER flush_memcached and restart_all 8. Works as expected I can get it to work correctly by using flush_memcached and restart_all (koha-testing-docker). However, before the patch was applied this was not required. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110809|0 |1 is obsolete| | --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 110830 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110830&action=edit Bug 26261: Split calendar.inc into include file and JavaScript file This patch moves most of the JavaScript out of calendar.inc and into a new file, calendar.js. English strings in calendar.js are now wrapped in the double-underscore function to allow for translation. The patch shouldn't affect datepicker functionality in any way. To test, apply the patch and test the datepicker in various contexts: - Reports -> Statistics wizards -> Patrons - Date of birth "from" and "to" should be linked so that the former must come before the latter. - Patrons -> Add or edit patron - The date of birth field datepicker shouldn't allow you to pick a future year from the dropdown. - Tools -> Calendar. - Test that the calendar tool works correctly. - Test with various settings of the dateformat system preference. TESTING TRANSLATABILITY - Update a translation, e.g. fr-FR:
cd misc/translator perl translate update fr-FR
- Open the corresponding .po file for JavaScript strings, e.g. misc/translator/po/fr-FR-messages-js.po - Locate strings pulled from koha-tmpl/intranet-tmpl/prog/en/js/calendar.js for translation, e.g.: msgid "August" msgstr "" - Edit the "msgstr" string however you want (it's just for testing). - Install the updated translation:
perl translate install fr-FR
- Switch to your newly translated language in the staff client and test the datepicker again. Translated strings like days of the week and months should be correct. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.11.00 |20.11.00, 20.05.05 released in| | Status|Pushed to master |Pushed to stable CC| |lucas@bywatersolutions.com --- Comment #6 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 20.05.x for 20.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz --- Comment #7 from Aleisha Amohia <aleisha@catalyst.net.nz> --- enhancement, not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28351 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 [Bug 28351] Cannot set restrictions when dateformat is other than mm/dd/yyyy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30315 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30315 [Bug 30315] Calendar widget in staff interface no longer translates -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|30315 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30315 [Bug 30315] Calendar widget in staff interface no longer translates -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org