Tomorrow, Yesterday and or in the new Flatpickr datepicker don't translate. Today does, I am not sure why. I think it should be either only one underscore in an .inc file or it's something else. I tried updating the po files locally, but the strings didn't show up. ++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -34,6 +34,7 @@ <!-- / calendar.inc --> [% Asset.js("js/calendar.js") | $raw %] [% Asset.js("lib/flatpickr/flatpickr.min.js") | $raw %] +[% Asset.js("lib/flatpickr/shortcut-buttons-flatpickr.min.js") | $raw %] <script> flatpickr.l10ns.default.weekdays = flatpickr_weekdays; flatpickr.l10ns.default.months = flatpickr_months; @@ -84,6 +85,38 @@ $(on_close_focus).focus(); } }, + plugins: [ + ShortcutButtonsPlugin({ + button: [ + { + label: __("Yesterday") + }, + { + label: __("Today") + }, + { + label: __("Tomorrow") + } + ], + label: "or",
> I tried updating the po files locally, but the strings didn't show up. It's JS runtime translations, so it goes from ln-LN-messages-js.po to locale_data.js, but it's not detected by the parser (or we should do some magic?)... Let's call for JD for help :), we bumped a lot before release. I did the update for .po manually and it worked (in ITEM EDIT page for example): *** fi-FI-messages-js.po.orig --- fi-FI-messages-js.po *************** *** 1305,1314 **** --- 1305,1323 ---- msgid "Thursday" msgstr "Torstai" + #: koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc:92 + msgid "Yesterday" + msgstr "Eilen" + + #: koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc:95 #: koha-tmpl/intranet-tmpl/prog/js/calendar.js:111 msgid "Today" msgstr "Tänään" + #: koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc:98 + msgid "Tomorrow" + msgstr "Huomenna" + #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:291 #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:658 msgid "Today's checkouts"
the parallel issue I found: these translations make flatpickr translated on the ITEM EDIT page, but not translate all three words at all on the USER EDIT page. (/me researching)
(In reply to Andrew Nugged from comment #1) > > I tried updating the po files locally, but the strings didn't show up. > > It's JS runtime translations, so it goes from ln-LN-messages-js.po to > locale_data.js, but it's not detected by the parser (or we should do some > magic?)... Let's call for JD for help :), we bumped a lot before release. Yes, but a git grep didn't bring the string up in any of the .po files. The issue might be the file ending. This is an .inc, so it's not parsed as a .js but like a .tt file. This is .js code, but the translation tool doesn't know or expect it (is my guess) > I did the update for .po manually and it worked (in ITEM EDIT page for > example): > > > *** fi-FI-messages-js.po.orig > --- fi-FI-messages-js.po > *************** > *** 1305,1314 **** > --- 1305,1323 ---- > msgid "Thursday" > msgstr "Torstai" > > + #: koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc:92 > + msgid "Yesterday" > + msgstr "Eilen" > + > + #: koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc:95 > #: koha-tmpl/intranet-tmpl/prog/js/calendar.js:111 > msgid "Today" > msgstr "Tänään" > > + #: koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc:98 > + msgid "Tomorrow" > + msgstr "Huomenna" > + > #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:291 > #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:658 > msgid "Today's checkouts"
Try changing __ to _ maybe?
the parallel issue I found: these translations make flatpickr translated on the ITEM EDIT page accordingly to the current language, but I found strange behavior on the USER EDIT page: it sticks to some language from available (randomly? I am researching) and is ignorant to the current chosen language (wth?)
That does sound odd, good luck for the bug hunting! It's a prominent spot, so I hope we can figure it out for .1
Created attachment 128102 [details] [review] Bug 29588: (bug 29478 follow-up) Make strings translatable "or", "Yesterday", "Today" and "Tomorrow" are not translatable, we are using __ when _ should be used (__ is for .js files only). Test plan: 0. Apply the patch 1. cd misc/translator && perl translate update fr-FR 2. Edit misc/translator/po/fr-FR-staff-prog.po Search for "or", "Yesterday", "Today" and "Tomorrow" and translate them 3. cd misc/translator && perl translate install fr-FR 4. Enable fr-FR (syspref 'language') 5. Edit a patron and an item and confirm that the flatpickr widget has the strings correctly translated
For whatever reason I couldn't get "Tomorrow" to translate. I tried it with fr-FR and de-DE - there was a translation for that already available, but it didn't change anything in the staff interface. (All the other ones worked as expected.)
(In reply to David Nind from comment #8) > For whatever reason I couldn't get "Tomorrow" to translate. I tried it with > fr-FR and de-DE - there was a translation for that already available, but it > didn't change anything in the staff interface. (All the other ones worked as > expected.) Did you remove the fuzzy line? It should look like that (fr-FR): 62284 #: koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc:38 62285 msgid "Tomorrow" 62286 msgstr "Demain"
(In reply to Jonathan Druart from comment #9) > Did you remove the fuzzy line? > It should look like that (fr-FR): I didn't - this now works as expected now. Thanks Jonathan!
Created attachment 128121 [details] [review] Bug 29588: (bug 29478 follow-up) Make strings translatable "or", "Yesterday", "Today" and "Tomorrow" are not translatable, we are using __ when _ should be used (__ is for .js files only). Test plan: 0. Apply the patch 1. cd misc/translator && perl translate update fr-FR 2. Edit misc/translator/po/fr-FR-staff-prog.po Search for "or", "Yesterday", "Today" and "Tomorrow" and translate them 3. cd misc/translator && perl translate install fr-FR 4. Enable fr-FR (syspref 'language') 5. Edit a patron and an item and confirm that the flatpickr widget has the strings correctly translated Signed-off-by: David Nind <david@davidnind.com>
Created attachment 128126 [details] [review] Bug 29588: (bug 29478 follow-up) Make strings translatable "or", "Yesterday", "Today" and "Tomorrow" are not translatable, we are using __ when _ should be used (__ is for .js files only). Test plan: 0. Apply the patch 1. cd misc/translator && perl translate update fr-FR 2. Edit misc/translator/po/fr-FR-staff-prog.po Search for "or", "Yesterday", "Today" and "Tomorrow" and translate them 3. cd misc/translator && perl translate install fr-FR 4. Enable fr-FR (syspref 'language') 5. Edit a patron and an item and confirm that the flatpickr widget has the strings correctly translated Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com>
Created attachment 128509 [details] [review] Bug 29588: (bug 29478 follow-up) Make strings translatable "or", "Yesterday", "Today" and "Tomorrow" are not translatable, we are using __ when _ should be used (__ is for .js files only). Test plan: 0. Apply the patch 1. cd misc/translator && perl translate update fr-FR 2. Edit misc/translator/po/fr-FR-staff-prog.po Search for "or", "Yesterday", "Today" and "Tomorrow" and translate them 3. cd misc/translator && perl translate install fr-FR 4. Enable fr-FR (syspref 'language') 5. Edit a patron and an item and confirm that the flatpickr widget has the strings correctly translated Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Man.. that's an easy hole to fall into! Works as expected now, Passing QA
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
Pushed to 21.11.x for 21.11.02
Missing dependency, not backported to 21.05.x