Skip to content
Browse files

Examples of translate and localize

  • Loading branch information...
1 parent b59b583 commit f10f62e3ba745bfb66023bc84c37f2ba9fe6c5a2 @akitaonrails committed Jul 12, 2012
Showing with 9 additions and 2 deletions.
  1. +7 −0 app/views/welcome/index.html.erb
  2. +2 −2 config/application.rb
View
7 app/views/welcome/index.html.erb
@@ -3,3 +3,10 @@
<p>
<%= t("hello") %>
</p>
+
+<ul>
+ <li><%= number_to_currency(100.0) %></li>
+ <li><%= l(Time.current, :format => :long) %></li>
+ <li><%= distance_of_time_in_words Time.now, Time.now + 2.hours %></li>
+ <li><%= User.human_attribute_name(:password) %></li>
+</ul>
View
4 config/application.rb
@@ -27,11 +27,11 @@ 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 = 'Brasilia'
# 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]
- # config.i18n.default_locale = :de
+ config.i18n.default_locale = :"pt-BR"
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"

0 comments on commit f10f62e

Please sign in to comment.
Something went wrong with that request. Please try again.