diff options
author | Jay Hayes <jay@bignerdranch.com> | 2013-10-19 10:33:47 -0500 |
---|---|---|
committer | Jay Hayes <jay@bignerdranch.com> | 2013-10-19 10:33:47 -0500 |
commit | da1d2fb483b521419ce6c350bc6a5721266c0fc6 (patch) | |
tree | 164847bbb800043fb75a5e8820c8827837120023 /guides/source | |
parent | d96c5a8782b80de0d684f4e85747e459301353a5 (diff) | |
download | rails-da1d2fb483b521419ce6c350bc6a5721266c0fc6.tar.gz rails-da1d2fb483b521419ce6c350bc6a5721266c0fc6.tar.bz2 rails-da1d2fb483b521419ce6c350bc6a5721266c0fc6.zip |
Update I18n guide to note the additional features of the `translate` view helper
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/i18n.md | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/guides/source/i18n.md b/guides/source/i18n.md index 33daa79133..837a07ddbb 100644 --- a/guides/source/i18n.md +++ b/guides/source/i18n.md @@ -492,12 +492,14 @@ Overview of the I18n API Features You should have good understanding of using the i18n library now, knowing all necessary aspects of internationalizing a basic Rails application. In the following chapters, we'll cover it's features in more depth. +These chapters will show examples using both th `I18n.translate` method as well as the [`translate` view helper method](http://api.rubyonrails.org/classes/ActionView/Helpers/TranslationHelper.html#method-i-translate) (noting the additional feature provide by the view helper method). + Covered are features like these: * looking up translations * interpolating data into translations * pluralizing translations -* using safe HTML translations +* using safe HTML translations (view helper method only) * localizing dates, numbers, currency, etc. ### Looking up Translations @@ -585,6 +587,8 @@ you can look up the `books.index.title` value **inside** `app/views/books/index. <%= t '.title' %> ``` +NOTE: Automatic translation scoping by partial is only available from the `translate` view helper method. + ### Interpolation In many cases you want to abstract your translations so that **variables can be interpolated into the translation**. For this reason the I18n API provides an interpolation feature. @@ -673,6 +677,8 @@ en: <div><%= t('title.html') %></div> ``` +NOTE: Automatic conversion to HTML safe translate text is only available from the `translate` view helper method. + ![i18n demo html safe](images/i18n/demo_html_safe.png) How to Store your Custom Translations |