Browse files

copy edits 302e570

  • Loading branch information...
vijaydev committed Sep 20, 2011
1 parent caf42a8 commit 03d30635dfb51f70ac769d20ea3319135260fe0c
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.
# 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

0 comments on commit 03d3063

Please sign in to comment.