From e6d083acdac970e7d88905016d1c0c47d2d73c65 Mon Sep 17 00:00:00 2001 From: Wen-Tien Chang Date: Fri, 8 Jan 2010 15:45:13 +0800 Subject: [PATCH] Add zh_tw locale file --- app/controllers/admin/snippets_controller.rb | 2 +- app/views/layouts/admin.html.erb | 10 +++++----- config/environment.rb | 2 +- config/locales/zh_tw.yml | 7 +++++++ 4 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 config/locales/zh_tw.yml diff --git a/app/controllers/admin/snippets_controller.rb b/app/controllers/admin/snippets_controller.rb index 5678fdbb..026be61e 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 a8ae0280..bc25c1c4 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 e8a77c71..1f165efd 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 00000000..d2527bed --- /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