diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-09-20 19:47:33 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-09-20 19:47:33 +0530 |
commit | 5684ecf74966d81e6fa7193689881b5243cbbc39 (patch) | |
tree | 4bebe9e7121b26490ccde5d0d21bd40c66d45c28 | |
parent | ed1ada84ac5b443ef979c14a4d0f1a8a57fe9ab9 (diff) | |
download | rails-5684ecf74966d81e6fa7193689881b5243cbbc39.tar.gz rails-5684ecf74966d81e6fa7193689881b5243cbbc39.tar.bz2 rails-5684ecf74966d81e6fa7193689881b5243cbbc39.zip |
copy edits 302e5707
-rw-r--r-- | railties/guides/source/i18n.textile | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/railties/guides/source/i18n.textile b/railties/guides/source/i18n.textile index 14ce6a19d5..11e1473ba2 100644 --- a/railties/guides/source/i18n.textile +++ b/railties/guides/source/i18n.textile @@ -365,14 +365,13 @@ NOTE: You need to restart the server when you add new locale files. You may use YAML (+.yml+) or plain Ruby (+.rb+) files for storing your translations in SimpleStore. YAML is the preferred option among Rails developers. However, it has one big disadvantage. YAML is very sensitive to whitespace and special characters, so the application may not load your dictionary properly. Ruby files will crash your application on first request, so you may easily find what's wrong. (If you encounter any "weird issues" with YAML dictionaries, try putting the relevant portion of your dictionary into a Ruby file.) -h4. Passing variables into the translation +h4. Passing variables to translations -You may use translation with parameters, if you want. +You can use variables in the translation messages and pass their values from the view. <ruby> # app/views/home/index.html.erb -<h1><%=t 'greet_username', :user => "Bill", :message => "Goodbye" %></h1> -<h1><%=t 'greet_username', :user => "DHH", :message => "Hello" %></h1> +<%=t 'greet_username', :user => "Bill", :message => "Goodbye" %> # config/locales/en.yml en: |