Bug 30315

Summary: Calendar widget on patron form in staff interface no longer translates
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: I18N/L10NAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: frederic
Version: 20.11   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 29684    
Bug Blocks:    

Description Katrin Fischer 2022-03-18 08:46:29 UTC
The 'old' calendar widget does no longer translate in 20.11. We have just updated to the latest version 20.11.16.

To test:
* Run 20.11.x
* Install translatons, de-DE should be complete
* Activate language for staff interface in system preferences
* Go to patrons and open any patron account
* Look at the date widgets for date of birth, expiration date
* Verify day names and buttons remained English, while rest of page has been translated.
Comment 1 Katrin Fischer 2022-03-18 08:55:44 UTC
Strings are from de-DE-messages-js.po, but I could verify that the translation of the .js messages works fine in other places.

Example:
https://translate.koha-community.org/de/20.11/translate/de-DE-messages-js.po#unit=15031161&offset=0

* Add something to your cart in staff
* Add something to your cart in staff _again_
* Verify pop-up message is translated
Comment 2 Katrin Fischer 2022-05-17 14:07:57 UTC
In 20.11.18 I still have the problem, in our package based installations, but also on my kohadevbox. 

Any clues much appreciated.

Tested with de-DE and the date of birth in put on the patron form.
Comment 3 Katrin Fischer 2022-05-17 14:41:21 UTC
Trying to narrow this down a bit. Git bisect turned up this as the breaking commit:

commit 701fde53ed703c751e37fd184de342838e8a9f2f
Author: Owen Leonard <oleonard@myacpl.org>
Date:   Thu Aug 20 20:10:40 2020 +0000

    Bug 26261: Split calendar.inc into include file and JavaScript file
Comment 4 Katrin Fischer 2022-05-17 14:55:10 UTC
Confirmed it's broken in 20.05.05 which the patch was first included to.
Comment 5 Owen Leonard 2022-05-17 16:14:33 UTC
I think the root of the problem is that locale data isn't being loaded by the template because the "lang" variable is getting overwritten at some point. 

I think this is related to:

Bug 24661 - Inclusion of locale-related javascript files is broken

and

Bug 29684 - Warning File not found: js/locale_data.js

Without the correct "lang" template variable the link to the correct locale_date file is bad:

/intranet-tmpl/prog/fr-FR/js/locale_data_20.1118000.js
Comment 6 Katrin Fischer 2022-05-18 14:44:36 UTC
Further narrowed it down: the calendar is only broken on the patron member form, which we hadn't noticed before. This makes bug 29684 a good candidate, but it's not a one line fix.

Maybe this is WONTFIX?