Summary: | Yesterday and tomorrow in datepicker don't translate | ||
---|---|---|---|
Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
Component: | I18N/L10N | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
Severity: | normal | ||
Priority: | P5 - low | CC: | andrew, david, f.demians, fridolin.somers, jonathan.druart, kyle, martin.renvoize, nugged |
Version: | Main | Keywords: | rel_21_11_candidate |
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This fixes "or", "Yesterday", "Today" and "Tomorrow" in the flatpickr date selector so they can be translated. (This was because __ was used when _ should have been used (__ is for .js files only)).
|
Version(s) released in: |
22.05.00,21.11.02
|
Circulation function: | |||
Bug Depends on: | 29478 | ||
Bug Blocks: | |||
Attachments: |
Bug 29588: (bug 29478 follow-up) Make strings translatable
Bug 29588: (bug 29478 follow-up) Make strings translatable Bug 29588: (bug 29478 follow-up) Make strings translatable Bug 29588: (bug 29478 follow-up) Make strings translatable |
Description
Katrin Fischer
2021-11-28 22:41:02 UTC
> 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 |