Bugzilla – Attachment 181216 Details for
Bug 38340
Translatability - Standard form include files are not translatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38340: Make Standard ILL backend templates translatable
Bug-38340-Make-Standard-ILL-backend-templates-tran.patch (text/plain), 3.50 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-04-21 13:03:22 UTC
(
hide
)
Description:
Bug 38340: Make Standard ILL backend templates translatable
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-04-21 13:03:22 UTC
Size:
3.50 KB
patch
obsolete
>From 5b290c64598d61e7aff3b6219ccf56e41569834b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 11 Feb 2025 18:45:04 +0000 >Subject: [PATCH] Bug 38340: Make Standard ILL backend templates translatable > >This patchset moves the `Standard` backend templates into the right >places so they are picked up for translation. > >To test: >1. Apply this patches >2. Notice the `Standard` ILL backend works as expected >3. Run: > $ ktd --shell > k$ cd misc/translator/po > k$ git fetch ; git reset --hard origin/main > k$ cd .. > k$ perl translate update es-ES > k$ cd po > k$ git diff >4. Inside the diff pager, make a search for 'backends/Standard' >=> SUCCESS: There are strings that come from the Standard backend! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >--- > Koha/ILL/Request.pm | 55 ++++++++++++++++++++++++++++----------------- > 1 file changed, 34 insertions(+), 21 deletions(-) > >diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm >index d89e91bda72..12321b77718 100644 >--- a/Koha/ILL/Request.pm >+++ b/Koha/ILL/Request.pm >@@ -1157,34 +1157,47 @@ sub expand_template { > my ( $self, $params ) = @_; > my $backend = $self->_backend->name; > >- # Generate path to file to load >- my $backend_dir; >- my $backend_tmpl; >+ if ( $backend eq 'Standard' ) { > >- if ( $self->{_plugin} ) { >+ my $template_name = 'ill/backends/Standard/' . ( $params->{method} // q{} ) . '.inc'; > >- $backend_dir = $self->{_plugin}->bundle_path; >- $backend_tmpl = $backend_dir; >+ # Set files to load >+ $params->{template} = $template_name; >+ $params->{opac_template} = $template_name; > >- } elsif ( $backend eq 'Standard' ) { >- >- # Check for core Standard backend >- $backend_tmpl = dirname(__FILE__) . '/Backend'; > } else { >+ my $plugin = >+ $self->{_plugin} >+ ? $self->{_plugin} >+ : $self->get_plugin( $self->_backend->name ); > >- # Old way of loading backends: Through backend_dir config >- $backend_dir = $self->_config->backend_dir; >- $backend_tmpl = join "/", $backend_dir, $backend; >- } >+ # Generate path to file to load >+ my $backend_dir; >+ my $backend_tmpl; >+ >+ if ($plugin) { >+ >+ # New way of loading backends: Through plugins >+ $backend_dir = $plugin->bundle_path; >+ $backend_tmpl = $backend_dir; >+ >+ } else { >+ >+ # Old way of loading backends: Through backend_dir config >+ $backend_dir = $self->_config->backend_dir; >+ $backend_tmpl = join "/", $backend_dir, $backend; >+ } > >- my $intra_tmpl = join "/", $backend_tmpl, "intra-includes", >- ( $params->{method} // q{} ) . ".inc"; >- my $opac_tmpl = join "/", $backend_tmpl, "opac-includes", >- ( $params->{method} // q{} ) . ".inc"; >+ my $intra_tmpl = join "/", $backend_tmpl, "intra-includes", >+ ( $params->{method} // q{} ) . ".inc"; >+ my $opac_tmpl = join "/", $backend_tmpl, "opac-includes", >+ ( $params->{method} // q{} ) . ".inc"; >+ >+ # Set files to load >+ $params->{template} = $intra_tmpl; >+ $params->{opac_template} = $opac_tmpl; >+ } > >- # Set files to load >- $params->{template} = $intra_tmpl; >- $params->{opac_template} = $opac_tmpl; > return $params; > } > >-- >2.49.0
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 38340
:
177749
|
177750
|
178057
|
178058
|
178079
|
178080
|
178414
|
178415
|
178416
|
178418
|
178420
|
178421
|
178422
|
180066
|
180067
|
180068
|
181215
|
181216
|
181217
|
181294
|
181391
|
181392
|
181435
|
181541
|
181542
|
181543
|
181544
|
181549