Bugzilla – Attachment 185828 Details for
Bug 33856
Inventory tool CSV export contains untranslatable strings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33856: Make inventory problems translatable
Bug-33856-Make-inventory-problems-translatable.patch (text/plain), 3.17 KB, created by
Marion Durand
on 2025-08-27 14:43:23 UTC
(
hide
)
Description:
Bug 33856: Make inventory problems translatable
Filename:
MIME Type:
Creator:
Marion Durand
Created:
2025-08-27 14:43:23 UTC
Size:
3.17 KB
patch
obsolete
>From d8a307db157aa02887bfe7bc96b4e310f5fa8786 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 7 Jun 2023 10:49:05 +0200 >Subject: [PATCH] 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 >--- > tools/inventory.pl | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > >diff --git a/tools/inventory.pl b/tools/inventory.pl >index 8e735d40e4..f178bb6db5 100755 >--- a/tools/inventory.pl >+++ b/tools/inventory.pl >@@ -35,6 +35,7 @@ use C4::Circulation qw( barcodedecode AddReturn ); > use C4::Reports::Guided qw( ); > use C4::Charset qw( NormalizeString ); > >+use Koha::I18N qw(__); > use Koha::Biblios; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Database::Columns; >@@ -445,7 +446,7 @@ if ( defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on' ) > my ( $table, $column ) = split '\.', $key; > push @translated_keys, NormalizeString( $columns->{$table}->{$column} // '' ); > } >- push @translated_keys, 'Problem' if $uploadbarcodes; >+ push @translated_keys, __('Problem') if $uploadbarcodes; > > $csv->combine(@translated_keys); > print $csv->string, "\n"; >@@ -460,19 +461,19 @@ if ( defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on' ) > my $errstr = ''; > foreach my $key ( keys %{ $item->{problems} } ) { > if ( $key eq 'wrongplace' ) { >- $errstr .= "wrong place,"; >+ $errstr .= __("wrong place") . ","; > } elsif ( $key eq 'changestatus' ) { >- $errstr .= "unselected notforloan status $item->{notforloan},"; >+ $errstr .= __("unselected notforloan status") . " $item->{notforloan},"; > } elsif ( $key eq 'not_scanned' ) { >- $errstr .= "missing,"; >+ $errstr .= __("missing") . ","; > } elsif ( $key eq 'no_barcode' ) { >- $errstr .= "no barcode,"; >+ $errstr .= __("no barcode") . ","; > } elsif ( $key eq 'checkedout' ) { >- $errstr .= "checked out,"; >+ $errstr .= __("checked out") . ","; > } elsif ( $key eq 'out_of_order' ) { >- $errstr .= "shelved out of order,"; >+ $errstr .= __("shelved out of order") . ","; > } elsif ( $key eq 'lost' ) { >- $errstr .= "item was lost"; >+ $errstr .= __("item was lost"); > } > } > >@@ -488,6 +489,7 @@ if ( defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on' ) > if ( $error->{'ERR_BARCODE'} ) { > push @line, map { $_ eq 'barcode' ? $error->{'barcode'} : '' } @keys; > push @line, "barcode not found"; >+ push @line, __("barcode not found"); > $csv->combine(@line); > print $csv->string, "\n"; > } >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33856
:
152078
|
185828
|
185847
|
186189