diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2010-12-29 02:07:22 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2010-12-29 02:07:22 +0530 |
commit | 98368546719cf09b3bc2c88735f7d72ffc048679 (patch) | |
tree | 1d409660c36a4537f426e071b67e17a9197ddbf0 /railties | |
parent | 9f75545e5d0aded71f973edd0e5ff4daf3e7c580 (diff) | |
download | rails-98368546719cf09b3bc2c88735f7d72ffc048679.tar.gz rails-98368546719cf09b3bc2c88735f7d72ffc048679.tar.bz2 rails-98368546719cf09b3bc2c88735f7d72ffc048679.zip |
fixed examples & minor typos
Diffstat (limited to 'railties')
-rw-r--r-- | railties/guides/source/i18n.textile | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/railties/guides/source/i18n.textile b/railties/guides/source/i18n.textile index 46e3b80a76..de2bc78eac 100644 --- a/railties/guides/source/i18n.textile +++ b/railties/guides/source/i18n.textile @@ -10,7 +10,7 @@ So, in the process of _internationalizing_ your Rails application you have to: * Tell Rails where to find locale dictionaries * Tell Rails how to set, preserve and switch locale -In the process of _localizing_ your application you'll probably want to do following three things: +In the process of _localizing_ your application you'll probably want to do the following three things: * Replace or supplement Rails' default locale -- e.g. date and time formats, month names, Active Record model names, etc * Abstract strings in your application into keyed dictionaries -- e.g. flash messages, static text in your views, etc. @@ -305,12 +305,12 @@ end # app/controllers/home_controller.rb class HomeController < ApplicationController def index - flash[:notice] = "Hello flash!" + flash[:notice] = "Hello Flash" end end # app/views/home/index.html.erb -<h1>Hello world!</h1> +<h1>Hello World</h1> <p><%= flash[:notice] %></p> </ruby> @@ -344,8 +344,8 @@ So let's add the missing translations into the dictionary files (i.e. do the "lo <ruby> # config/locales/en.yml en: - hello_world: Hello World - hello_flash: Hello Flash + hello_world: Hello world! + hello_flash: Hello flash! # config/locales/pirate.yml pirate: @@ -586,7 +586,7 @@ I18n.t :foo I18n.l Time.now </ruby> -Explicitely passing a locale: +Explicitly passing a locale: <ruby> I18n.t :foo, :locale => :de @@ -623,7 +623,7 @@ pt: bar: baz </ruby> -As you see, in both cases the toplevel key is the locale. +:foo+ is a namespace key and +:bar+ is the key for the translation "baz". +As you see, in both cases the top level key is the locale. +:foo+ is a namespace key and +:bar+ is the key for the translation "baz". Here is a "real" example from the Active Support +en.yml+ translations YAML file: |