From dc7cf82a95b8ca3fb3ac65597b99fc3cfee2bfe8 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 19 Jan 2018 17:07:00 +0800 Subject: [PATCH] languages fix --- app/controllers/admin/page_contents_controller.rb | 2 +- app/views/admin/page_contents/_index.html.erb | 2 +- config/locales/en.yml | 1 + config/locales/zh_tw.yml | 7 ++++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin/page_contents_controller.rb b/app/controllers/admin/page_contents_controller.rb index f444fba..60e7092 100644 --- a/app/controllers/admin/page_contents_controller.rb +++ b/app/controllers/admin/page_contents_controller.rb @@ -1,7 +1,7 @@ class Admin::PageContentsController < OrbitAdminController before_action ->(module_app = @app_title) { set_variables module_app } def index - @table_fields = [:page_id, :name,:version,:update_at,:last_modified, :category] + @table_fields = ["page_content.id", :name,:version,:update_at,:last_modified, :category] @filter_fields = {} if params[:sort].blank? && params[:keywords].blank? @pages = get_pages_sorted(Page.root) diff --git a/app/views/admin/page_contents/_index.html.erb b/app/views/admin/page_contents/_index.html.erb index 516139c..8ef13c5 100644 --- a/app/views/admin/page_contents/_index.html.erb +++ b/app/views/admin/page_contents/_index.html.erb @@ -26,7 +26,7 @@ <%= User.find(page.page_contexts.last.update_user_id).user_name rescue nil %> <% if can_edit_or_delete?(page) %> - <%= select_tag("category_id",options_for_select(@categories, (page.category_id.to_s rescue "")), prompt: "Select a category", class: "category_select", style: "margin-bottom:0; width:150px;") %> + <%= select_tag("category_id",options_for_select(@categories, (page.category_id.to_s rescue "")), prompt: t("select_category"), class: "category_select", style: "margin-bottom:0; width:150px;") %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 39b001c..109d6dd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -5,6 +5,7 @@ en: view_count: View count save: Save all: All + id: ID wiki: Wiki Pages parent_page: Parent Page Id create_page_content_success: Page content was successfully created diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 1ce6856..06c8560 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -4,11 +4,12 @@ zh_tw: context: 內文 view_count: 瀏覽人次 save: 送出 - wiki: Wiki Pages - parent_page: Parent Page Id + wiki: Wiki分頁 + parent_page: 父頁帳號 create_page_content_success: 建立頁面內容成功 editing_page_content: 編輯頁面內容 - all: All + all: 全部 + id: 帳號 frontend: page: 頁面前台 update_page_content_success: 更新頁面內容成功 \ No newline at end of file