Skip to content
This repository has been archived by the owner on Nov 21, 2017. It is now read-only.

Commit

Permalink
「3.4 フォームの日本語化」「3.5 タイムゾーンの設定」
Browse files Browse the repository at this point in the history
  • Loading branch information
yohhatu committed Dec 29, 2011
1 parent 3cd336e commit 75432e7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
8 changes: 4 additions & 4 deletions app/views/tasks/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
</ul>
<% end %>
<ui>
<li><%= form.label :name, "名称" %><%= form.text_field :name %></li>
<li><%= form.label :name %><%= form.text_field :name %></li>
<li>
<%= form.label :due_date, "期限" %>
<%= form.label :due_date %>
<%= form.date_select :due_date, :use_month_numbers => true,
:order => [ :year, :month, :day ],
:start_year => Time.current.year,
:end_year => Time.current.year + 1 %>
</li>
<li><%= form.check_box :done %><%= form.label :done, "実施済み" %></li>
<li><%= form.label :description, "説明" %><%= form.text_area :description %></li>
<li><%= form.check_box :done %><%= form.label :done %></li>
<li><%= form.label :description %><%= form.text_area :description %></li>
<li><%= form.submit "送信" %></li>
</ui>
<%= link_to "タスク一覧へ", :tasks %>
Expand Down
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class Application < Rails::Application
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
config.time_zone = 'Tokyo'


# 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}').to_s]
Expand Down
16 changes: 8 additions & 8 deletions config/locales/attributes.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ja:
activerecord:
attributes:
task:
name: 名称
description: 説明
due_date: 期限
done: 実施済み
ja:
activerecord:
attributes:
task:
name: 名称
description: 説明
due_date: 期限
done: 実施済み

0 comments on commit 75432e7

Please sign in to comment.