Permalink
Browse files

copy edits 302e570

  • Loading branch information...
1 parent ed1ada8 commit 5684ecf74966d81e6fa7193689881b5243cbbc39 @vijaydev vijaydev committed Sep 20, 2011
Showing with 3 additions and 4 deletions.
  1. +3 −4 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:

0 comments on commit 5684ecf

Please sign in to comment.