Bug 38450 - Missing translation string in catalogue_detail.inc
Summary: Missing translation string in catalogue_detail.inc
Status: Signed Off
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: Testopia
URL:
Keywords: RM_priority
Depends on:
Blocks:
 
Reported: 2024-11-14 16:58 UTC by Andreas Jonsson
Modified: 2024-11-27 21:18 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
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: _("This %s is picked").format(foo) However, strings using this format were not: _("This %s is NOT picked".format(bar))
Version(s) released in:
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

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>