Bugzilla – Attachment 155240 Details for
Bug 34034
Move translatable strings out of opac-bottom.inc: OverDrive and OpenLibrary
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34034: Move translatable strings out of opac-bottom.inc: OverDrive and OpenLibrary
Bug-34034-Move-translatable-strings-out-of-opac-bo.patch (text/plain), 6.25 KB, created by
David Nind
on 2023-09-05 21:32:29 UTC
(
hide
)
Description:
Bug 34034: Move translatable strings out of opac-bottom.inc: OverDrive and OpenLibrary
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-09-05 21:32:29 UTC
Size:
6.25 KB
patch
obsolete
>From 3dd9fff5f779e140fb35d8529d3aab6967615bd1 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 16 Jun 2023 12:47:29 +0000 >Subject: [PATCH] Bug 34034: Move translatable strings out of opac-bottom.inc: > OverDrive and OpenLibrary > >This patch removes some string variable definitions from >opac-bottom.inc. The strings can now be picked up for translation from >the corresponding <script> block. > >To test you must enable OpenLibrarySearch and enter OverDrive >credentials to enable OverDrive search integration. > >- Perform a search in the OPAC. >- As the results page loads you should see at the top "Searching > OverDrive..." and "Searching OpenLibrary..." >- When the searches complete you should see "Found X results in the > library's Y collection" for each service. >- Try to trigger an error message by entering the wrong (non-zero) value > for the OverDriveLibraryID preference. >- The search results page should show "Error searching OverDrive > collection" > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 5 ----- > .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 12 ++++++------ > 2 files changed, 6 insertions(+), 11 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 855d564595..38404237e3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -136,11 +136,6 @@ > [% END %] > > <script> >- var MSG_SEARCHING = _("Searching %s..."); >- var MSG_ERROR_SEARCHING_COLLECTION = _("Error searching %s collection"); >- var MSG_NO_RESULTS_FOUND_IN_COLLECTION = _("No results found in the library's %s collection"); >- var MSG_RESULTS_FOUND_IN_COLLECTION = _("Found %s results in the library's %s collection"); >- > [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) %] > var MSG_TAGS_DISABLED = _("Sorry, tags are not enabled on this system."); > var MSG_TAG_ALL_BAD = _("Error! Your tag was entirely markup code. It was NOT added. Please try again with plain text."); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 4182f5ad45..ce3214dd60 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -814,7 +814,7 @@ > }); > [% END # /IF OpacHighlightedWords %] > [% IF ( OverDriveEnabled ) %] >- var $overdrive_results = $( '<div id="overdrive-results">' + MSG_SEARCHING.format('OverDrive') + ' <img class="throbber" src="[% interface | html %]/[% theme | html %]/images/spinner-small.gif" /></div>' ); >+ var $overdrive_results = $( '<div id="overdrive-results">' + _("Searching %s...").format('OverDrive') + ' <img class="throbber" src="[% interface | html %]/[% theme | html %]/images/spinner-small.gif" /></div>' ); > $( '#numresults' ) .after( $overdrive_results ); > //Clean querystring, first we remove CCL entities, then decode HTML entities, then swap double quotes for single quotes > //as the overdrive API treats double quotes as a search term and returns extra results >@@ -823,28 +823,28 @@ > od_querystring = od_querystring.replace(/\"/g,"'"); > KOHA.OverDrive.Search( "[% Koha.Preference('OverDriveLibraryID') | html %]", od_querystring, 1, 0, function( data ) { > if ( data.error ) { >- $overdrive_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OverDrive') ); >+ $overdrive_results.html( _("Error searching %s collection").format('OverDrive') ); > return; > } > > if ( data.totalItems ) { >- $overdrive_results.html( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + encodeURIComponent( od_querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.totalItems, 'OverDrive') + '</a>' ); >+ $overdrive_results.html( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + encodeURIComponent( od_querystring ) + '">' + _("Found %s results in the library's %s collection").format(data.totalItems, 'OverDrive') + '</a>' ); > } else { > $overdrive_results.remove(); > } > } ); > [% END # /IF OverDriveEnabled %] > [% IF ( OpenLibrarySearch ) %] >- var $openlibrary_results = $( '<div id="openlibrary-results">' + MSG_SEARCHING.format('OpenLibrary' ) + ' <img class="throbber" src="[% interface | html %]/[% theme | html %]/images/spinner-small.gif" /></div>' ); >+ var $openlibrary_results = $( '<div id="openlibrary-results">' + _("Searching %s...").format('OpenLibrary' ) + ' <img class="throbber" src="[% interface | html %]/[% theme | html %]/images/spinner-small.gif" /></div>' ); > $( '#numresults' ) .after( $openlibrary_results ); > KOHA.OpenLibrary.search( querystring, null, function( data ) { > if ( data.error ) { >- $openlibrary_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OpenLibrary') ); >+ $openlibrary_results.html( _("Error searching %s collection").format('OpenLibrary') ); > return; > } > > if ( data.numFound > 0 ) { >- $openlibrary_results.html( '<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.numFound, 'OpenLibrary') + '</a>' ); >+ $openlibrary_results.html( '<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">' + _("Found %s results in the library's %s collection").format(data.numFound, 'OpenLibrary') + '</a>' ); > } else { > $openlibrary_results.remove(); > } >-- >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 34034
:
152411
|
155240
|
156709