Bugzilla – Attachment 152432 Details for
Bug 34026
Move translatable cover-handling strings out of opac-bottom.inc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34026: Move translatable cover-handling strings out of opac-bottom.inc
Bug-34026-Move-translatable-cover-handling-strings.patch (text/plain), 6.63 KB, created by
Owen Leonard
on 2023-06-16 15:47:25 UTC
(
hide
)
Description:
Bug 34026: Move translatable cover-handling strings out of opac-bottom.inc
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-06-16 15:47:25 UTC
Size:
6.63 KB
patch
obsolete
>From 0bd8410a1e0382581e77b67b4f49f2961242a859 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 15 Jun 2023 18:56:25 +0000 >Subject: [PATCH] Bug 34026: Move translatable cover-handling strings out of > opac-bottom.inc > >This patch removes several instances from opac-bottom.inc where we >define strings for translation and use in separate JavaScript files. The >JavaScript files are updated to use the __() function to mark strings >for translation. > >Note: Definition of the variable NO_COCE_JACKET is removed because it is >unused. > >To test, apply the patch and clear your browser cache if necessary. > >- In the staff interface, enable OPAC cover image services: > - OPACAmazonCoverImages > - BakerTaylorEnabled > - GoogleJackets > - OpenLibraryCovers > >- In the OPAC, perform a search and confirm that there are no JS errors > on the search results page related to cover images. >- Check the bibliographic detail page as well. > >To confirm that the strings are being picked up for translation, run the >update process for another language, e.g. > >perl misc/translator/translate update fr-FR > >Then check the newly-built po file: fr-FR-messages-js.po. It should >list the updated files: > > koha-tmpl/opac-tmpl/bootstrap/js/amazonimages.js:8 > koha-tmpl/opac-tmpl/bootstrap/js/amazonimages.js:10 > koha-tmpl/opac-tmpl/bootstrap/js/bakertaylorimages.js:7 > koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js:77 > koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js:63 >--- > .../bootstrap/en/includes/opac-bottom.inc | 19 ------------------- > .../opac-tmpl/bootstrap/js/amazonimages.js | 4 ++-- > .../bootstrap/js/bakertaylorimages.js | 2 +- > .../opac-tmpl/bootstrap/js/google-jackets.js | 2 +- > .../opac-tmpl/bootstrap/js/openlibrary.js | 2 +- > 5 files changed, 5 insertions(+), 24 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index b0497410c20..6e51188a3f8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -128,9 +128,6 @@ > </script> > [% Asset.js("js/global.js") | $raw %] > [% IF ( OPACAmazonCoverImages || SyndeticsCoverImages ) %] >- <script> >- var NO_AMAZON_IMAGE = _("No cover image available"); >- </script> > [% Asset.js("js/amazonimages.js") | $raw %] > [% END %] > >@@ -179,9 +176,6 @@ > var MSG_MULTI_ADD_TAG_FAILED = _("Unable to add one or more tags."); > var MSG_NO_TAG_SPECIFIED = _("No tag was specified."); > [% END %] >- [% IF OpenLibraryCovers || OpenLibrarySearch %] >- var NO_OL_JACKET = _("No cover image available"); >- [% END %] > [% IF (query_desc) %] > var query_desc = "[% query_desc | html %]"; > var querystring = "[% querystring | html %]"; >@@ -228,11 +222,6 @@ > [% IF Koha.Preference( 'opacuserlogin' ) == 1 %][% IF Koha.Preference( 'TagsEnabled' ) == 1 %][% Asset.js("js/tags.js") | $raw %][% END %][% END %] > [% IF ( GoogleJackets ) %] > [% Asset.js("js/google-jackets.js") | $raw %] >- <script> >- >- var NO_GOOGLE_JACKET = _("No cover image available"); >- >- </script> > [% END %] > [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %] > [% Asset.js("js/coce.js") | $raw %] >@@ -245,22 +234,14 @@ > > [% IF OPACLocalCoverImages %] > [% Asset.js("js/localcovers.js") | $raw %] >- <script> >- >- var NO_LOCAL_JACKET = _("No cover image available"); >- >- </script> > [% END %] > > [% IF ( BakerTaylorEnabled ) %] > [% Asset.js("js/bakertaylorimages.js") | $raw %] > <script> >- >- var NO_BAKERTAYLOR_IMAGE = _("No cover image available"); > $(window).load(function(){ > bt_verify_images(); > }); >- > </script> > [% END %] > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/amazonimages.js b/koha-tmpl/opac-tmpl/bootstrap/js/amazonimages.js >index f7b4887e553..acb21518f26 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/amazonimages.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/amazonimages.js >@@ -5,9 +5,9 @@ function verify_images() { > w = this.width; > h = this.height; > if ((w == 1) || (h == 1)) { >- $(this).parent().html("<span class=\"no-image\">"+NO_AMAZON_IMAGE+"</span>"); >+ $(this).parent().html("<span class=\"no-image\">"+ __("No cover image available") +"</span>"); > } else if ((this.complete != null) && (!this.complete)) { >- $(this).parent().html("<span class=\"no-image\">"+NO_AMAZON_IMAGE+"</span>"); >+ $(this).parent().html("<span class=\"no-image\">"+ __("No cover image available") +"</span>"); > } > } > }); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/bakertaylorimages.js b/koha-tmpl/opac-tmpl/bootstrap/js/bakertaylorimages.js >index 00b025a56df..cda542e277a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/bakertaylorimages.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/bakertaylorimages.js >@@ -4,7 +4,7 @@ function bt_verify_images() { > if (this.src.indexOf('btol.com') >= 0) { > h = this.height; > if (h == 20) { >- $(this).before("<span class=\"no-image\" style=\"margin-bottom:5px;width:80px;\">"+NO_BAKERTAYLOR_IMAGE+"</span>"); >+ $(this).before("<span class=\"no-image\" style=\"margin-bottom:5px;width:80px;\">"+ __("No cover image available" ) +"</span>"); > } > } > }); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js b/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js >index 00ca8296413..c030fff2d20 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js >@@ -74,7 +74,7 @@ KOHA.Google = { > } else { > var message = document.createElement("span"); > $(message).attr("class","no-image"); >- $(message).html(NO_GOOGLE_JACKET); >+ $(message).html(__("No cover image available")); > $(this).empty().append(message); > } > }); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js b/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js >index 41dcfb9fab3..ee08b535c1f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js >@@ -60,7 +60,7 @@ KOHA.OpenLibrary = new function() { > } else { > var message = document.createElement("span"); > $(message).attr("class","no-image"); >- $(message).html(NO_OL_JACKET); >+ $(message).html( __("No cover image available") ); > $(this).append(message); > } > }); >-- >2.30.2
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 34026
:
152393
|
152432
|
156701
|
156706
|
156707