Bugzilla – Attachment 178415 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.53 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-02-20 13:39:26 UTC
(
hide
)
Description:
Bug 38340: Make Standard ILL backend templates translatable
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-02-20 13:39:26 UTC
Size:
3.53 KB
patch
obsolete
>From 8562da2b614d39ea3d2b551f5a4d8ad8a71c074a 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> >--- > Koha/ILL/Request.pm | 54 ++++++++++++++++++++++++++------------------- > 1 file changed, 31 insertions(+), 23 deletions(-) > >diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm >index 90035032e42..cf6dc31d99d 100644 >--- a/Koha/ILL/Request.pm >+++ b/Koha/ILL/Request.pm >@@ -1156,36 +1156,44 @@ 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' ) { > >- my $backend_plugin = $self->get_backend_plugin( $self->_backend->name ); >- if ($backend_plugin) { >+ my $template_name = 'ill/backends/Standard/' . ( $params->{method} // q{} ) . '.inc'; > >- # New way of loading backends: Through plugins >- $backend_dir = $backend_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 $backend_plugin = $self->get_backend_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 ($backend_plugin) { >+ >+ # New way of loading backends: Through plugins >+ $backend_dir = $backend_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.48.1
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