diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 52585ac2dd..76632283c6 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -956,8 +956,10 @@ sub _availability { my ($itemnumber) = @_; my $item = Koha::Items->find($itemnumber); + use Koha::I18N; + unless ( $item ) { - return ( undef, 'unknown', 'Error: could not retrieve availability for this ID', undef ); + return ( undef, __('unknown'), __('Error: could not retrieve availability for this ID'), undef ); } my $biblionumber = $item->biblioitemnumber; @@ -966,17 +968,17 @@ sub _availability { my $itemcallnumber = $item->itemcallnumber; if ( $item->notforloan ) { - return ( $biblionumber, 'not available', 'Not for loan', $location, $itemcallnumber ); + return ( $biblionumber, __('not available'), __('Not for loan'), $location, $itemcallnumber ); } elsif ( $item->onloan ) { - return ( $biblionumber, 'not available', 'Checked out', $location, $itemcallnumber ); + return ( $biblionumber, __('not available'), __('Checked out'), $location, $itemcallnumber ); } elsif ( $item->itemlost ) { - return ( $biblionumber, 'not available', 'Item lost', $location, $itemcallnumber ); + return ( $biblionumber, __('not available'), __('Item lost'), $location, $itemcallnumber ); } elsif ( $item->withdrawn ) { - return ( $biblionumber, 'not available', 'Item withdrawn', $location, $itemcallnumber ); + return ( $biblionumber, __('not available'), __('Item withdrawn'), $location, $itemcallnumber ); } elsif ( $item->damaged ) { - return ( $biblionumber, 'not available', 'Item damaged', $location, $itemcallnumber ); + return ( $biblionumber, __('not available'), __('Item damaged'), $location, $itemcallnumber ); } else { - return ( $biblionumber, 'available', undef, $location, $itemcallnumber ); + return ( $biblionumber, __('available'), undef, $location, $itemcallnumber ); } } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt index 506617749e..5af7fdf14f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt @@ -124,6 +124,8 @@
return_fmt (Optional)
requests a particular format or set of formats in reporting availability
+
language (Optional)
+
requests a particular language for the output, default is the opac cookie language if set, the first language in opac language list or english

Example call

diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl index 8613ac1267..5b105246fa 100755 --- a/opac/ilsdi.pl +++ b/opac/ilsdi.pl @@ -100,7 +100,7 @@ my %required = ( # List of optional arguments my %optional = ( 'Describe' => [], - 'GetAvailability' => [ 'return_type', 'return_fmt' ], + 'GetAvailability' => [ 'return_type', 'return_fmt', 'language' ], 'GetRecords' => ['schema'], 'GetAuthorityRecords' => ['schema'], 'LookupPatron' => ['id_type'],