forked from saurabh/personal-honor
i18n for query all kinds of honors
This commit is contained in:
parent
117d22bcf7
commit
04d59309fc
|
@ -4,7 +4,7 @@ class PersonalHonorsController < ApplicationController
|
||||||
filter_value = params[:honors_filter_value]
|
filter_value = params[:honors_filter_value]
|
||||||
honors = nil
|
honors = nil
|
||||||
|
|
||||||
if filter_value.nil? || filter_value == 'all' || filter_value.empty?
|
if filter_value.nil? || filter_value == t("personal_honor.honor_types_all") || filter_value.empty?
|
||||||
honors = Honor.where(:award_name.ne => nil).or(:award_name.ne => "").sort_for_frontend.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
|
honors = Honor.where(:award_name.ne => nil).or(:award_name.ne => "").sort_for_frontend.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
|
||||||
else
|
else
|
||||||
honor_type_id = HonorType.or({ 'title.en' => filter_value }, { 'title.zh_tw' => filter_value }).first.id
|
honor_type_id = HonorType.or({ 'title.en' => filter_value }, { 'title.zh_tw' => filter_value }).first.id
|
||||||
|
@ -56,7 +56,7 @@ class PersonalHonorsController < ApplicationController
|
||||||
|
|
||||||
current_locale = I18n.locale
|
current_locale = I18n.locale
|
||||||
honor_types = HonorType.all.pluck(:title).map { |title| { 'honor_type' => title[current_locale] } }
|
honor_types = HonorType.all.pluck(:title).map { |title| { 'honor_type' => title[current_locale] } }
|
||||||
honor_types.unshift({ 'honor_type' => 'all' })
|
honor_types.unshift({ 'honor_type' => t("personal_honor.honor_types_all") })
|
||||||
|
|
||||||
{
|
{
|
||||||
"honors" => honor_list,
|
"honors" => honor_list,
|
||||||
|
|
|
@ -9,6 +9,7 @@ en:
|
||||||
awarding_unit : "Awarding Unit"
|
awarding_unit : "Awarding Unit"
|
||||||
honor_category : "Honor Category"
|
honor_category : "Honor Category"
|
||||||
honor_type: "Honor Category"
|
honor_type: "Honor Category"
|
||||||
|
honor_types_all: "All Honor Types"
|
||||||
extracted_chapters : "Extracted Chapters"
|
extracted_chapters : "Extracted Chapters"
|
||||||
publishers : "Publishers"
|
publishers : "Publishers"
|
||||||
honoree: "Honoree"
|
honoree: "Honoree"
|
||||||
|
@ -59,4 +60,4 @@ en:
|
||||||
save: "save"
|
save: "save"
|
||||||
hintText: "Type in a search term"
|
hintText: "Type in a search term"
|
||||||
noResultsText: "No results"
|
noResultsText: "No results"
|
||||||
searchingText: "Searching…"
|
searchingText: "Searching…"
|
||||||
|
|
|
@ -9,6 +9,7 @@ zh_tw:
|
||||||
awarding_unit : "頒獎單位"
|
awarding_unit : "頒獎單位"
|
||||||
honor_category : "類別"
|
honor_category : "類別"
|
||||||
honor_type: "類別"
|
honor_type: "類別"
|
||||||
|
honor_types_all: "所有榮譽項目"
|
||||||
honoree: "受獎人"
|
honoree: "受獎人"
|
||||||
authors : "作者"
|
authors : "作者"
|
||||||
tags : "領域"
|
tags : "領域"
|
||||||
|
@ -55,4 +56,4 @@ zh_tw:
|
||||||
save: "儲存"
|
save: "儲存"
|
||||||
hintText: "請輸入搜尋關鍵字"
|
hintText: "請輸入搜尋關鍵字"
|
||||||
noResultsText: "沒有相關的比對結果"
|
noResultsText: "沒有相關的比對結果"
|
||||||
searchingText: "搜尋中…"
|
searchingText: "搜尋中…"
|
||||||
|
|
Loading…
Reference in New Issue