Bug 38450 - Missing translation string in catalogue_detail.inc
Summary: Missing translation string in catalogue_detail.inc
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords: RM_priority
Depends on:
Blocks:
 
Reported: 2024-11-14 16:58 UTC by Andreas Jonsson
Modified: 2025-03-21 04:13 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes some missing strings in the po files used for translation. Strings in this format were being included for translation: _("This %s is picked").format(foo) However, strings using this format were not: _("This %s is NOT picked".format(bar))
Version(s) released in:
25.05.00,24.11.02
Circulation function:


Attachments
Bug 38450: Fix some translation pickups (5.92 KB, patch)
2024-11-18 10:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38450: Fix some translation pickups (5.96 KB, patch)
2024-11-27 21:13 UTC, David Nind
Details | Diff | Splinter Review
Bug 38450: Fix some translation pickups (6.06 KB, patch)
2024-12-06 09:51 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Jonsson 2024-11-14 16:58:31 UTC
The string "Waiting at %s, %s since %s." in koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc is missing in Weblate. Is there a problem with the string extraction?
Comment 1 Katrin Fischer 2024-11-14 17:00:14 UTC
We found out today that the strings hadn't been synced properly for a little while. Please check again tomorrow!
Comment 2 Jonathan Druart 2024-11-14 18:34:01 UTC
Indeed, please check again tomorrow.
Comment 3 Jonathan Druart 2024-11-18 09:55:13 UTC
This is valid.
Comment 4 Jonathan Druart 2024-11-18 10:04:49 UTC
Created attachment 174672 [details] [review]
Bug 38450: Fix some translation pickups

_("This %s is picked").format(foo)
_("This %s is NOT picked".format(bar))

Both constructs are valid, but our translation script does not pick the
second one.

I found very few occurrences (using `git grep '.".format('`) that are
displayed on the UI. I don't have the time right now to deep dive into
the translation script to fix this problem, easier to adjust the
occurrences.

How to prevent that in the future however? We could raise a warning from
the QA script.

Test plan:
Do not apply this patch
Generate the strings (`gulp po:update --lang LANG`)
cd misc/translator/po && git commit -a -m"wip"
Apply this patch, regenerate the strings
cd misc/translator/po && git diff

Notice the changes, you should see new translations added to the .po
files.
Ideally translate them, install the templates and confirm that the new
strings are translated on the UI.
Comment 5 Jonathan Druart 2024-11-18 10:07:47 UTC
(In reply to Jonathan Druart from comment #4)
> How to prevent that in the future however? We could raise a warning from
> the QA script.

Opened https://gitlab.com/koha-community/qa-test-tools/-/issues/89
Comment 6 David Nind 2024-11-27 21:13:08 UTC
Created attachment 175013 [details] [review]
Bug 38450: Fix some translation pickups

_("This %s is picked").format(foo)
_("This %s is NOT picked".format(bar))

Both constructs are valid, but our translation script does not pick the
second one.

I found very few occurrences (using `git grep '.".format('`) that are
displayed on the UI. I don't have the time right now to deep dive into
the translation script to fix this problem, easier to adjust the
occurrences.

How to prevent that in the future however? We could raise a warning from
the QA script.

Test plan:
Do not apply this patch
Generate the strings (`gulp po:update --lang LANG`)
cd misc/translator/po && git commit -a -m"wip"
Apply this patch, regenerate the strings
cd misc/translator/po && git diff

Notice the changes, you should see new translations added to the .po
files.
Ideally translate them, install the templates and confirm that the new
strings are translated on the UI.

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 Marcel de Rooy 2024-12-06 09:51:34 UTC
Created attachment 175256 [details] [review]
Bug 38450: Fix some translation pickups

_("This %s is picked").format(foo)
_("This %s is NOT picked".format(bar))

Both constructs are valid, but our translation script does not pick the
second one.

I found very few occurrences (using `git grep '.".format('`) that are
displayed on the UI. I don't have the time right now to deep dive into
the translation script to fix this problem, easier to adjust the
occurrences.

How to prevent that in the future however? We could raise a warning from
the QA script.

Test plan:
Do not apply this patch
Generate the strings (`gulp po:update --lang LANG`)
cd misc/translator/po && git commit -a -m"wip"
Apply this patch, regenerate the strings
cd misc/translator/po && git diff

Notice the changes, you should see new translations added to the .po
files.
Ideally translate them, install the templates and confirm that the new
strings are translated on the UI.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Katrin Fischer 2024-12-23 08:38:14 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 9 Paul Derscheid 2025-02-03 19:09:16 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.01
Comment 10 Alex Buckley 2025-03-19 20:56:44 UTC
Hi Jonathan,

We are testing this patchset for backport to 24.05.x

I would like to check I am testing it correctly please:

===

BEFORE APPLYING PATCH ON 24.05.X

kohadev-koha@kohadevbox:koha((4470b0f18cc...))$ gulp po:update --lang en-NZ
[20:46:41] Using gulpfile /kohadevbox/koha/gulpfile.js
[20:46:41] Starting 'po:update'...
[20:46:41] Starting 'po_update_marc_marc21'...
[20:46:41] Starting 'po_update_marc_unimarc'...
[20:46:41] Starting 'po_update_staff'...
[20:46:41] Starting 'po_update_opac'...
[20:46:41] Starting 'po_update_pref'...
[20:46:41] Starting 'po_update_messages'...
[20:46:41] Starting 'po_update_messages_js'...
[20:46:41] Starting 'po_update_installer'...
[20:46:41] Starting 'po_update_installer_marc21'...
[20:46:41] Starting 'po_update_installer_unimarc'...
[20:46:41] Finished 'po_update_pref' after 452 ms
[20:46:42] Finished 'po_update_installer_unimarc' after 511 ms
[20:46:42] Finished 'po_update_installer' after 513 ms
[20:46:42] Finished 'po_update_installer_marc21' after 573 ms
[20:46:42] Finished 'po_update_messages_js' after 719 ms
[20:46:42] Finished 'po_update_marc_unimarc' after 1.03 s
[20:46:42] Finished 'po_update_opac' after 1.04 s
[20:46:42] Finished 'po_update_marc_marc21' after 1.42 s
[20:46:43] Finished 'po_update_messages' after 2.07 s
[20:46:45] Finished 'po_update_staff' after 3.51 s
[20:46:45] Finished 'po:update' after 3.51 s
kohadev-koha@kohadevbox:koha((4470b0f18cc...))$ cd misc/translator/po && git commit -a -m"wip"
Success, pre-commit checks passed
HEAD detached at upstream/24.05.x
Untracked files:
  (use "git add <file>..." to include in what will be committed)
	../Koha-installer-MARC21.pot
	../Koha-installer-UNIMARC.pot
	../Koha-installer.pot
	../Koha-marc-MARC21.pot
	../Koha-marc-UNIMARC.pot
	../Koha-messages-js.pot
	../Koha-messages.pot
	../Koha-opac-bootstrap.pot
	../Koha-pref.pot
	../Koha-staff-prog.pot

nothing added to commit but untracked files present (use "git add" to track)
kohadev-koha@kohadevbox:po((4470b0f18cc...))$ 


---

AFTER APPLYING PATCH ON 24.05.x

kohadev-koha@kohadevbox:koha((4470b0f18cc...))$ git cherry-pick 07bb1730fc78e8148caff0ebcf0cba22ba0a4f9f
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc
Auto-merging koha-tmpl/intranet-tmpl/prog/js/checkouts.js
Auto-merging koha-tmpl/intranet-tmpl/prog/js/elasticsearch-mappings.js
[detached HEAD 46aa2dd71e7] Bug 38450: Fix some translation pickups
 Author: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
 Date: Mon Nov 18 10:57:22 2024 +0100
 4 files changed, 6 insertions(+), 6 deletions(-)
kohadev-koha@kohadevbox:koha((46aa2dd71e7...))$ 
kohadev-koha@kohadevbox:koha((46aa2dd71e7...))$ 
kohadev-koha@kohadevbox:koha((46aa2dd71e7...))$ 
kohadev-koha@kohadevbox:koha((46aa2dd71e7...))$ gulp po:update --lang en-NZ
[20:37:52] Using gulpfile /kohadevbox/koha/gulpfile.js
[20:37:52] Starting 'po:update'...
[20:37:52] Starting 'po_update_marc_marc21'...
[20:37:52] Starting 'po_update_marc_unimarc'...
[20:37:52] Starting 'po_update_staff'...
[20:37:52] Starting 'po_update_opac'...
[20:37:52] Starting 'po_update_pref'...
[20:37:52] Starting 'po_update_messages'...
[20:37:52] Starting 'po_update_messages_js'...
[20:37:52] Starting 'po_update_installer'...
[20:37:52] Starting 'po_update_installer_marc21'...
[20:37:52] Starting 'po_update_installer_unimarc'...
[20:37:52] Finished 'po_update_installer_unimarc' after 508 ms
[20:37:52] Finished 'po_update_installer' after 509 ms
[20:37:52] Finished 'po_update_pref' after 654 ms
[20:37:52] Finished 'po_update_messages_js' after 660 ms
[20:37:52] Finished 'po_update_installer_marc21' after 690 ms
[20:37:53] Finished 'po_update_marc_unimarc' after 999 ms
[20:37:53] Finished 'po_update_opac' after 1.02 s
[20:37:53] Finished 'po_update_marc_marc21' after 1.41 s
[20:37:54] Finished 'po_update_messages' after 1.97 s
[20:37:55] Finished 'po_update_staff' after 3.39 s
[20:37:55] Finished 'po:update' after 3.39 s
kohadev-koha@kohadevbox:koha((46aa2dd71e7...))$ cd misc/translator/po && git diff
kohadev-koha@kohadevbox:po((46aa2dd71e7...))$ 


====

Notice there are no new translations added to the .po files after regenerating the strings.

Am I testing this incorrectly?
Comment 11 Jonathan Druart 2025-03-20 13:50:45 UTC
(In reply to Alex Buckley from comment #10)
> Hi Jonathan,
> 
> We are testing this patchset for backport to 24.05.x
> 
> I would like to check I am testing it correctly please:
> [skip]
> 
> Am I testing this incorrectly?

I think I've followed the exact same steps. However I have a diff

+#. For the first occurrence,
+#. SCRIPT
+#: koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc:78
+#: koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc:75
+#, fuzzy, c-format
+msgid "Waiting at %s since %s."
+msgstr "Billing date: %s From %s To %s %s All since %s %s "
 
+#. SCRIPT
+#: koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc:78
+#, fuzzy
+msgid "Waiting at %s, %s since %s."
+msgstr "Billing date: %s From %s To %s %s All since %s %s "


+#. SCRIPT
+#: koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc:1
+#, fuzzy
+msgid "A patron from %s"
+msgstr "User library"

Which are the expected changes.
Comment 12 Alex Buckley 2025-03-21 04:13:30 UTC
(In reply to Jonathan Druart from comment #11)
> (In reply to Alex Buckley from comment #10)
> > Hi Jonathan,
> > 
> > We are testing this patchset for backport to 24.05.x
> > 
> > I would like to check I am testing it correctly please:
> > [skip]
> > 
> > Am I testing this incorrectly?
> 
> I think I've followed the exact same steps. However I have a diff
> 
> +#. For the first occurrence,
> +#. SCRIPT
> +#:
> koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/
> catalogue_detail.inc:78
> +#: koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc:75
> +#, fuzzy, c-format
> +msgid "Waiting at %s since %s."
> +msgstr "Billing date: %s From %s To %s %s All since %s %s "
>  
> +#. SCRIPT
> +#:
> koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/
> catalogue_detail.inc:78
> +#, fuzzy
> +msgid "Waiting at %s, %s since %s."
> +msgstr "Billing date: %s From %s To %s %s All since %s %s "
> 
> 
> +#. SCRIPT
> +#: koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc:1
> +#, fuzzy
> +msgid "A patron from %s"
> +msgstr "User library"
> 
> Which are the expected changes.


Thank you for testing Jonathan.

We will look into getting this backported next month - to 24.05.09, now we are so close to the March release.