Bug 33856 - Inventory tool CSV export contains untranslatable strings
Summary: Inventory tool CSV export contains untranslatable strings
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: David Cook
URL:
Keywords:
Depends on: 22135
Blocks:
  Show dependency treegraph
 
Reported: 2023-05-29 15:55 UTC by Katrin Fischer
Modified: 2025-09-05 14:05 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:


Attachments
Bug 33856: Make inventory problems translatable (2.84 KB, patch)
2023-06-07 08:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 33856: Make inventory problems translatable (3.17 KB, patch)
2025-08-27 14:43 UTC, Marion Durand
Details | Diff | Splinter Review
Bug 33856: Make inventory problems translatable (3.67 KB, patch)
2025-08-28 06:57 UTC, Marion Durand
Details | Diff | Splinter Review
Bug 33856: Make inventory problems translatable (3.78 KB, patch)
2025-09-05 07:00 UTC, David Cook
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2023-05-29 15:55:26 UTC
The "Problem" header row label and the problems themselves are untranslatable as they are added in the inventory.pl file.
Comment 1 Jonathan Druart 2023-06-07 08:52:54 UTC
Created attachment 152078 [details] [review]
Bug 33856: Make inventory problems translatable

We should make the inventory 'problem' column translatable.

Test plan:
Update po, translate the new strings, install the language, use it for
the UI and confirm that the CSV generated has 'problem' column translated

gulp po:update --lang LANG
vim misc/translator/po/LANG-messages-js.po
cd misc/translator; perl translate install LANG
Comment 2 Katrin Fischer 2023-06-08 08:34:27 UTC
Hm, might need a little work with my dependent patch (I see yours still has problem instead of Problem)
Comment 3 David Cook 2023-09-06 00:01:48 UTC
Patch doesn't apply currently.

(In reply to Katrin Fischer from comment #2)
> Hm, might need a little work with my dependent patch (I see yours still has
> problem instead of Problem)

I think this is the first problem.

It also doesn't take into account bug 22135 and "shelved out of order" I think.
Comment 4 Marion Durand 2025-08-27 14:43:23 UTC
Created attachment 185828 [details] [review]
Bug 33856: Make inventory problems translatable

We should make the inventory 'problem' column translatable.

Test plan:
Update po, translate the new strings, install the language, use it for
the UI and confirm that the CSV generated has 'problem' column translated

gulp po:update --lang LANG
vim misc/translator/po/LANG-messages-js.po
cd misc/translator; perl translate install LANG
Comment 5 Marion Durand 2025-08-27 14:52:36 UTC
Patch rebased for master

Caution : I was not able to test it as I could not find how to generate the updated po files but I think this is due to my poor knowledge on how to do it.

On KTD
When I use `gulp po:update --lang fr-FR`
It generates new .pot files and update some .po files but the new chains are not in the file.

Might be something wrong but I can't figure out what.
Comment 6 David Cook 2025-08-28 01:35:27 UTC
Comment on attachment 185828 [details] [review]
Bug 33856: Make inventory problems translatable

Review of attachment 185828 [details] [review]:
-----------------------------------------------------------------

::: tools/inventory.pl
@@ +489,4 @@
>          if ( $error->{'ERR_BARCODE'} ) {
>              push @line, map { $_ eq 'barcode' ? $error->{'barcode'} : '' } @keys;
>              push @line, "barcode not found";
> +            push @line, __("barcode not found");

I think you've got a typo there where you didn't delete the untranslated line.
Comment 7 David Cook 2025-08-28 01:37:27 UTC
According to the commit message on 8044, it looks like you need to run "./translate update LANG" I think to get the .po files updated.
Comment 8 Marion Durand 2025-08-28 06:57:47 UTC
Created attachment 185847 [details] [review]
Bug 33856: Make inventory problems translatable

We should make the inventory 'problem' column translatable.

Test plan (assuming KTD):
1- Update po
    misc/translator/translate update LANG
    (for example LANG="fr-FR")
2- translate the new strings
    vim misc/translator/po/LANG-messages-js.po
    edit for example "wrong place" or "missing"
3- install the language
    koha-translate --install LANG --dev kohadev
4- use it for the UI and confirm that the CSV generated has 'problem' column translated
    a- Using the test language (activate it with sysprefStaffInterfaceLanguages)
    b- Go to Cataloging > Inventory
    c- Fill some barcode and some filter (for example a filter on callnumber)
    d- Select "Export to CSV file"
    e- Submit
    f- Open the CSV file generated, check that the colomn problem is now translated according to what you have filled in step 2
Comment 9 Marion Durand 2025-08-28 06:59:19 UTC
Thank you David for your help !

I corrected the typo and updated the commit message to detail more the process.

This time I was able to test the patch and I worked well for me.
Comment 10 David Cook 2025-09-05 06:56:11 UTC
I think the test plan was a bit off..

Revised Test plan (assuming KTD):
 0 - Apply the patch and koha-plack --restart kohadev
 1- Update po
     misc/translator/translate update fr-FR
 2- translate the new strings
     vim misc/translator/po/fr-FR-messages.po
     edit for example "wrong place" or "missing"
 3- install the language
     koha-translate --install fr-FR --dev kohadev
 4- use it for the UI and confirm that the CSV generated has 'problem' column
 translated
     a- Using the test language (activate it with
 syspref StaffInterfaceLanguages)
     b- Go to Cataloging > Inventory
     c- Fill some barcode and some filter (for example a filter on callnumber)
     d- Select "Export to CSV file"
     e- Submit
     f- Open the CSV file generated, check that the colomn problem is now
 translated according to what you have filled in step 2
Comment 11 David Cook 2025-09-05 06:57:58 UTC
(In reply to Marion Durand from comment #9)
> Thank you David for your help !
> 
> I corrected the typo and updated the commit message to detail more the
> process.
> 
> This time I was able to test the patch and I worked well for me.

I'm going to say that you've marked this as Signed Off too in this case
Comment 12 David Cook 2025-09-05 07:00:57 UTC
Created attachment 186189 [details] [review]
Bug 33856: Make inventory problems translatable

We should make the inventory 'problem' column translatable.

Test plan (assuming KTD):
1- Update po
    misc/translator/translate update LANG
    (for example LANG="fr-FR")
2- translate the new strings
    vim misc/translator/po/LANG-messages-js.po
    edit for example "wrong place" or "missing"
3- install the language
    koha-translate --install LANG --dev kohadev
4- use it for the UI and confirm that the CSV generated has 'problem' column translated
    a- Using the test language (activate it with sysprefStaffInterfaceLanguages)
    b- Go to Cataloging > Inventory
    c- Fill some barcode and some filter (for example a filter on callnumber)
    d- Select "Export to CSV file"
    e- Submit
    f- Open the CSV file generated, check that the colomn problem is now translated according to what you have filled in step 2

Signed-off-by: Marion Durand <marion.durand@biblibre.com>

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 13 Marion Durand 2025-09-05 07:07:24 UTC
Thank you David for your help !

I didn't actually signed it off because I wasn't sure if I could as I rebased the patch. Thanks for adding my signoff
Comment 14 David Cook 2025-09-05 07:21:19 UTC
(In reply to Marion Durand from comment #13)
> Thank you David for your help !
> 
> I didn't actually signed it off because I wasn't sure if I could as I
> rebased the patch. Thanks for adding my signoff

Fair enough! Doesn't hurt to be cautious!
Comment 15 Lucas Gass (lukeg) 2025-09-05 14:05:24 UTC
Nice work everyone!

Pushed to main for 25.11