Bugzilla – Attachment 69101 Details for
Bug 17602
Integrate support for RecordedBooks (formerly OneClickDigital) API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17602: Translations rework
Bug-17602-Translations-rework.patch (text/plain), 10.57 KB, created by
Srdjan Jankovic
on 2017-11-13 01:49:43 UTC
(
hide
)
Description:
Bug 17602: Translations rework
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2017-11-13 01:49:43 UTC
Size:
10.57 KB
patch
obsolete
>From 48e29ef8ba3c04a4eec234d5439a909f6f34465a Mon Sep 17 00:00:00 2001 >From: Srdjan <srdjan@catalyst.net.nz> >Date: Mon, 13 Nov 2017 14:25:33 +1300 >Subject: [PATCH] Bug 17602: Translations rework > >--- > .../opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 8 ++++++++ > .../bootstrap/en/modules/opac-recordedbooks-search.tt | 16 ++++++++-------- > .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 18 +++++++++--------- > 3 files changed, 25 insertions(+), 17 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 8346691..f37a02b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -113,6 +113,14 @@ $.widget.bridge('uitooltip', $.ui.tooltip); > var MSG_CONFIRM_AGAIN = _("Warning: Cannot be undone. Please confirm once again") > var MSG_DELETE_SEARCH_HISTORY = _("Are you sure you want to delete your search history?"); > var MSG_NO_SUGGESTION_SELECTED = _("No suggestion was selected"); >+ 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"); >+ var MSG_BY = _("by"); >+ var MSG_TYPE = _("Type"); >+ var MSG_NEXT = _("Next"); >+ var MSG_PREVIOUS = _("Previous"); > [% IF Koha.Preference( 'opacbookbag' ) == 1 or Koha.Preference( 'virtualshelves' ) == 1 %] > var MSG_BASKET_EMPTY = _("Your cart is currently empty"); > var MSG_RECORD_IN_BASKET = _("The item is already in your cart"); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt >index b90f6ac..07c9f05 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt >@@ -66,22 +66,22 @@ var querystring = "[% q |replace( "'", "\'" ) |replace( '\n', '\\n' ) |replace( > var results_per_page = [% OPACnumSearchResults || 20 %]; > > function search( page ) { >- $( '#recordedbooks-status' ).html( _("Searching RecordedBooks...") + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></span>' ); >+ $( '#recordedbooks-status' ).html( MSG_SEARCHING.format("RecordedBooks") + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></span>' ); > > KOHA.RecordedBooks.search( querystring, results_per_page, page, function( data ) { > if ( data.error ) { >- $( '#recordedbooks-status' ).html( '<strong class="unavailable">' + _("Error searching RecordedBooks collection") + ': ' + data.error + '</strong>' ); >+ $( '#recordedbooks-status' ).html( '<strong class="unavailable">' + MSG_ERROR_SEARCHING_COLLECTION.format("RecordedBooks") + ': ' + data.error + '</strong>' ); > return; > } > > if ( !data.total ) { >- $( '#recordedbooks-status' ).html( '<strong>' + _("No results found in the library's RecordedBooks collection.") + '</strong>' ); >+ $( '#recordedbooks-status' ).html( '<strong>' + MSG_NO_RESULTS_FOUND_IN_COLLECTION.format("RecordedBooks") + '</strong>' ); > return; > } > > $( '#recordedbooks-results-list tbody' ).empty(); > >- $( '#recordedbooks-status' ).html( '<strong>' + _("Found") + ' ' + data.total + ' ' + _("results in the library's RecordedBooks collection.") + '</strong>' ); >+ $( '#recordedbooks-status' ).html( '<strong>' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.total, "RecordedBooks") + '</strong>' ); > > for ( var i = 0; data.items[i]; i++ ) { > var prod = data.items[i]; >@@ -94,9 +94,9 @@ function search( page ) { > results.push( prod.title ); > if (prod.url) results.push( '</a>' ); > results.push( '</span>' ); >- results.push( '<p>' + _("by") + ' ', prod.author, '</p>' ); >+ results.push( '<p>' + MSG_BY + ' ', prod.author, '</p>' ); > if (prod.description) results.push( '<p>' + prod.description, '</p>' ); >- results.push( '<span class="results_summary mediatype"><span class="label">' + _("Type:") + ' </span>', prod.media, '</span>' ); >+ results.push( '<span class="results_summary mediatype"><span class="label">' + MSG_TYPE + ': </span>', prod.media, '</span>' ); > > results.push( '</td>' ); > >@@ -125,7 +125,7 @@ function search( page ) { > if (data.total == page*results_per_page) max_page++; > > if ( page != 1 ) { >- pages.push( '<li><a class="od-nav" href="#" data-page="' + (page - 1) + '">« ' + _("Previous") + '</a></li>' ); >+ pages.push( '<li><a class="od-nav" href="#" data-page="' + (page - 1) + '">« ' + MSG_PREVIOUS + '</a></li>' ); > } > > for ( var p = Math.max( 0, page - 9 ); p <= Math.min( max_page, p + 9 ); p++ ) { >@@ -137,7 +137,7 @@ function search( page ) { > } > > if ( page < max_page ) { >- pages.push( ' <li><a class="od-nav" href="#" data-page="' + (page + 1) + '">' + _("Next") + ' »</a></li>' ); >+ pages.push( ' <li><a class="od-nav" href="#" data-page="' + (page + 1) + '">' + MSG_NEXT + ' »</a></li>' ); > } > > if ( pages.length > 1 ) $( '#top-pages, #bottom-pages' ).find( '.pagination' ).html( '<ul>' + pages.join( '' ) + '</ul>'); >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 e6c66e6..35abe15 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -892,52 +892,52 @@ $(document).ready(function(){ > $("#highlight_toggle_off").show().click(function() {highlightOff();}); > [% END %] > [% IF ( OverDriveEnabled ) %] >- var $overdrive_results = $( '<div id="overdrive-results">' + _( 'Searching OverDrive...' ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); >+ var $overdrive_results = $( '<div id="overdrive-results">' + MSG_SEARCHING.format('OverDrive') + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); > $( '#numresults' ) .append( ' ' ) > .append( $overdrive_results ); > KOHA.OverDrive.Search( "[% OverDriveLibraryID %]", querystring, 1, 0, function( data ) { > if ( data.error ) { >- $overdrive_results.html( _( 'Error searching OverDrive collection' ) ); >+ $overdrive_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OverDrive') ); > return; > } > > if ( data.totalItems ) { >- $overdrive_results.html( _( 'Found' ) + ' <a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + data.totalItems + ' ' + _( 'results' ) + '</a> ' + _( 'in OverDrive collection' ) ); >+ $overdrive_results.html( MSG_RESULTS_FOUND_IN_COLLECTION.format('<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + data.totalItems + '</a>', 'OverDrive') ); > } else { > $overdrive_results.remove(); > } > } ); > [% END %] > [% IF ( RecordedBooksEnabled ) %] >- var $recordedbooks_results = $( '<div id="recordedbooks-results">' + _( "Searching RecordedBooks..." ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); >+ var $recordedbooks_results = $( '<div id="recordedbooks-results">' + MSG_SEARCHING.format('RecordedBooks') + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); > $( '#numresults' ) .append( ' ' ) > .append( $recordedbooks_results ); > KOHA.RecordedBooks.search( querystring, [% OPACnumSearchResults || "null" %], null, function( data ) { > if ( data.error ) { >- $recordedbooks_results.html( _( "Error searching RecordedBooks collection: %s" ).format( data.error ) ); >+ $recordedbooks_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('RecordedBooks') + ': ' + data.error); > return; > } > > // data.total can be either 42 or "60+" > if ( typeof(data.total) === 'string' && data.total.charAt(0) > 0 || typeof(data.total) === 'number' && data.total > 0 ) { >- $recordedbooks_results.html( _( "Found %s results in RecordedBooks collection" ).format('<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + escape( querystring ) + '">' + data.total + '</a>') ); >+ $recordedbooks_results.html( MSG_RESULTS_FOUND_IN_COLLECTION.format('<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + escape( querystring ) + '">' + data.total + '</a>', 'RecordedBooks') ); > } else { > $recordedbooks_results.remove(); > } > } ); > [% END %] > [% IF ( OpenLibrarySearch ) %] >- var $openlibrary_results = $( '<div id="openlibrary-results">' + _( 'Searching Open Library...' ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); >+ var $openlibrary_results = $( '<div id="openlibrary-results">' + MSG_SEARCHING.format('OpenLibrary' ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); > $( '#numresults' ) .append( ' ' ) > .append( $openlibrary_results ); > KOHA.OpenLibrary.search( querystring, null, function( data ) { > if ( data.error ) { >- $openlibrary_results.html( _( 'Error searching OpenLibrary collection' ) ); >+ $openlibrary_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OpenLibrary') ); > return; > } > > if ( data.numFound > 0 ) { >- $openlibrary_results.html( _( 'Found' ) + ' <a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">' + data.numFound + ' ' + _( 'results' ) + '</a> ' + _( 'in OpenLibrary collection' ) ); >+ $openlibrary_results.html( MSG_RESULTS_FOUND_IN_COLLECTION.format('<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">' + data.numFound + '</a>', 'OpenLibrary') ); > } else { > $openlibrary_results.remove(); > } >-- >2.7.4
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 17602
:
57402
|
57403
|
57404
|
60855
|
60856
|
60857
|
61866
|
61932
|
62247
|
62248
|
62249
|
62250
|
63392
|
63778
|
63779
|
63780
|
63857
|
64070
|
64071
|
64095
|
64096
|
64098
|
64099
|
64100
|
65988
|
65989
|
66341
|
66342
|
66343
|
67236
|
67237
|
67238
|
67240
|
67859
|
67860
|
69019
|
69020
|
69021
|
69022
|
69023
|
69024
|
69025
|
69026
|
69027
|
69101
|
69357
|
69358
|
69359
|
73708
|
73709
|
73710
|
73711
|
73712
|
73713
|
73714
|
73715
|
73716
|
73717
|
73718
|
73719
|
73725
|
76180
|
76181
|
76182
|
76183
|
76184
|
76185
|
76186
|
76187
|
76188
|
76189
|
76190
|
76191
|
76192
|
76193
|
78602
|
78603
|
78604
|
78605
|
78606
|
78607
|
78608
|
78609
|
78610
|
78611
|
78612
|
78613
|
78614
|
78615
|
79247
|
79668
|
79669
|
79670
|
79671
|
79672
|
79673
|
79674
|
79675
|
79676
|
79677
|
79678
|
79679
|
79680
|
79681
|
79682
|
79752