Update personal_books_controller.rb

搜尋改為多語言
This commit is contained in:
chiu 2019-08-19 16:32:10 +08:00
parent e523087b96
commit 7f4b994670
1 changed files with 3 additions and 3 deletions

View File

@ -97,13 +97,13 @@ class PersonalBooksController < ApplicationController
choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "selected" : ""} choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "selected" : ""}
choice_select=choice_select.map{|value| {"choice_select" => value}} choice_select=choice_select.map{|value| {"choice_select" => value}}
choice_value=choice_value.map{|value| {"choice_value" => value}} choice_value=choice_value.map{|value| {"choice_value" => value}}
choice_default = params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_default = t("personal_book.select_class")
choice_show.unshift(choice_default) choice_show.unshift(choice_default)
choice_show=choice_show.map{|value| {"choice_show" => value}} choice_show=choice_show.map{|value| {"choice_show" => value}}
choice=choice_value.zip(choice_show,choice_select) choice=choice_value.zip(choice_show,choice_select)
choice=choice.map{|value| value.inject:merge} choice=choice.map{|value| value.inject:merge}
select_text = params[:locale]!='en' ? "搜尋類別:" : "search class:" select_text = t("personal_book.search_class")
search_text = params[:locale]!='en' ? "關鍵字搜尋:" : "word to search:" search_text = t("personal_book.word_to_search")
{ {
"book_list" => book_list, "book_list" => book_list,
"extras" => {"widget-title" => t("module_name.book"), "extras" => {"widget-title" => t("module_name.book"),