From da1d2fb483b521419ce6c350bc6a5721266c0fc6 Mon Sep 17 00:00:00 2001 From: Jay Hayes Date: Sat, 19 Oct 2013 10:33:47 -0500 Subject: Update I18n guide to note the additional features of the `translate` view helper --- guides/source/i18n.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'guides/source') 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:
<%= t('title.html') %>
``` +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 -- cgit v1.2.3