diff --git a/cps/static/js/get_meta.js b/cps/static/js/get_meta.js index f2b8fda3..2ee182bc 100644 --- a/cps/static/js/get_meta.js +++ b/cps/static/js/get_meta.js @@ -6,6 +6,7 @@ */ $(document).ready(function () { + var msg = i18n_msg; var douban = 'https://api.douban.com'; var db_search = '/v2/book/search'; var db_get_info = '/v2/book/'; @@ -74,7 +75,7 @@ $(document).ready(function () { } do_search = function (keyword) { show_flag = 0; - $('#meta-info').text('Loading...'); + $('#meta-info').text(msg.loading); var keyword = $('#keyword').val(); if (keyword) { db_search_book(keyword); @@ -93,7 +94,7 @@ $(document).ready(function () { db_results = data.books; }, error: function () { - $('#meta-info').html('
Search error!
'); + $('#meta-info').html(''+ msg.search_error+'!
'); }, complete: function () { db_done = true; @@ -108,8 +109,8 @@ $(document).ready(function () { $('#meta-info').html('No Result! Please try anonther keyword.
'); + if (!gg_results || !db_results) { + $('#meta-info').html(''+ msg.no_result +'
'); return; } } @@ -129,10 +130,10 @@ $(document).ready(function () { 'Author:' + book.volumeInfo.authors + '
' + - 'Publisher:' + book.volumeInfo.publisher + '
' + - 'Description:' + book.volumeInfo.description + '
' + - 'Source:Google Books
' + + ''+ msg.author +':' + book.volumeInfo.authors + '
' + + ''+ msg.publisher + ':' + book.volumeInfo.publisher + '
' + + ''+ msg.description + ':' + book.volumeInfo.description + '
' + + ''+ msg.source + ':Google Books
' + 'Author:' + book.author + '
' + - 'Publisher:' + book.publisher + '
' + - 'Description:' + book.summary + '
' + - 'Source:Douban Books
' + + '' + msg.author + ':' + book.author + '
' + + '' + msg.publisher + ':' + book.publisher + '
' + + '' + msg.description + ':' + book.summary + '
' + + '' + msg.source + ':Douban Books
' + '