diff --git a/app/controllers/admin/snippets_controller.rb b/app/controllers/admin/snippets_controller.rb index 5678fdbbe..026be61e5 100644 --- a/app/controllers/admin/snippets_controller.rb +++ b/app/controllers/admin/snippets_controller.rb @@ -26,7 +26,7 @@ class Admin::SnippetsController < ApplicationController end VALID_LOCALES.each do |locale| - @snippet.write_attribute( "content_#{locale}", "" ) + @snippet.send( :write_attribute, "content_#{locale}", "" ) end end diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index a8ae02800..bc25c1c4c 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -15,11 +15,11 @@
<%= yield %> diff --git a/config/environment.rb b/config/environment.rb index e8a77c71a..1f165efdf 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -40,7 +40,7 @@ Rails::Initializer.run do |config| # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')] - config.i18n.default_locale = "en" + config.i18n.default_locale = "zh_tw" end diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml new file mode 100644 index 000000000..d2527bed7 --- /dev/null +++ b/config/locales/zh_tw.yml @@ -0,0 +1,7 @@ +zh_tw: + admin: + home: 首頁 + page: 頁面管理 + snippet: 片段管理 + layout: 樣版管理 + announcement: 公告管理 \ No newline at end of file