From 7ab873aaea298c787e93438012fa8792345664f4 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 8 Jun 2015 03:18:35 +0200 Subject: [PATCH] Bug 11467: Bug Untranslatable srings in opac-detail.tt (IDreamBooks*, OpacBrowseResults) Patch marks several strings in the Javascript on the OPAC detail and result page for translation. 1) IDreamBooks* - Activate the 3 IDreamBooks* system preferences - Check the 'cloud' and additional content shows up correctly on the detail and result pages - Verify everything works as expected and the same as without the patch 2) OpacBrowseResults - Activate OpacBrowseResults - Do various searches - Verify the nex, previous, browse result list features still work the same as without the patch Bonus: Check new strings appear in the .po files by updating one language with the patch applied (perl translate update de-DE) NOTE: Really should have read the test plan more closely. I couldn't find the 'Go to detail:' section, until I clicked 'Browse results'. Signed-off-by: Mark Tompsett Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 8 ++++---- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 840f6ecce9..7d3c84c860 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1635,7 +1635,7 @@ isbn = isbn.replace(/-/, ''); [% IF ( IDreamBooksReadometer ) %] - $(".title").append(''+json.book.title+' by '+json.book.author+''); + $(".title").append(''+json.book.title+_('); [% END %] [% IF ( IDreamBooksReviews ) %] @@ -1644,11 +1644,11 @@ //append happy-sad cloud review - $("#catalogue_detail_biblio").append(""+json.book.title+" by "+json.book.author+""+json.book.rating+"% rating based on reviews at iDreamBooks.com"); + $("#catalogue_detail_biblio").append(""+json.book.title+_(" by ")+json.book.author+""+json.book.rating+"% "+_("rating based on reviews at iDreamBooks.com")+""); //insert data into Book reviews tab $.each(json.book.critic_reviews, function(){ - $("#idb_review_snippets").append("
\"..."+this.snippet+"...\"
Review date: "+this.review_date+"
"); + $("#idb_review_snippets").append("
\"..."+this.snippet+"...\"
"+_("Review date: ")+this.review_date+"
"); }); $("#seemoreidb").attr('href', json.book.detail_link); $("#tab_idb_critic_reviews").show(); @@ -1751,7 +1751,7 @@ if (arrPagination[i] == undefined || arrPagination[i].url == "") continue; var li = $("
  • "); var html = "" + i + "" + arrPagination[i].title + ""; - if (arrPagination[i].author) html += "
    by " + arrPagination[i].author; + if (arrPagination[i].author) html += "
    " + _("by") + " " + arrPagination[i].author; li.html(html); if (highlIndex && i == index) li.css("backgroundColor", "#DDDDDD"); ul.append(li); 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 d905f137b3..bbc5c2e479 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -716,7 +716,7 @@ $(document).ready(function(){ json = 'json = '+xdr.responseText; // the string now looks like.. json = { ... }; eval(json); // json is now a regular JSON object if(json.total_results > 0 && json.book.rating > 0){ - $(element).children('a').html(""+json.book.title+" by "+json.book.author+""+json.book.rating+"%"); + $(element).children('a').html(""+json.book.title+_(" by ")+json.book.author+""+json.book.rating+"%"); $(element).show(); } else { $(element).remove(); @@ -726,7 +726,7 @@ $(document).ready(function(){ } else { $.getJSON("https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){ if(json.total_results > 0 && json.book.rating > 0){ - $(element).children('a').html(""+json.book.title+" by "+json.book.author+""+json.book.rating+"%"); + $(element).children('a').html(""+json.book.title+_(" by ")+json.book.author+""+json.book.rating+"%"); $(element).show(); } else { $(element).remove(); -- 2.39.5