rails/guides
Oliver Günther 4692ed7e12
Document `deep_interpolation` parameter for bulk lookups
Bulk lookups are sort of an edge case, I have not heard of them until a colleague of mine decided to dynamically iterate over a growing set of translations and receiving them in bulk as a hash with `I18n.t 'welcome'` as in the example above.

When passing an interpolation to these bulk lookups, they will only be performed when also passing `deep_interpolation: true`.

**Without passing `deep_interpolation` flag:**
```ruby
I18n.t 'welcome', app_name: 'book store'
# => {:title=>"Welcome!", :content=>"Welcome to the %{app_name}"}

**With passing `deep_interpolation`:**
I18n.t 'welcome', deep_interpolation: true, app_name: 'book store'
# => {:title=>"Welcome!", :content=>"Welcome to the book store"}
```

I found this digging in the I18n lookup backend, the flag is listed on [I18n's Rubydoc](https://www.rubydoc.info/github/svenfuchs/i18n/master/I18n) but not otherwise listed. Since bulk lookups are mentioned here, I suggest to add a note with this flag along with it.
2018-10-25 07:46:58 +02:00
..
assets Replace outdated Rails Guides logo 2018-10-19 19:27:04 -04:00
bug_report_templates use "minitest" consistently 2018-09-11 23:57:25 +02:00
rails_guides Wrap custom id of a header attribute into \" in rails guides 2018-10-05 00:57:32 +03:00
source Document `deep_interpolation` parameter for bulk lookups 2018-10-25 07:46:58 +02:00
.document adds guides/.document to tell rdoc not to process this directory 2013-03-04 22:28:23 +01:00
CHANGELOG.md reflect c03bba4 in CHANGELOGs 2018-09-08 09:50:05 +02:00
Rakefile Enable Start/EndWith and RegexpMatch cops 2018-07-28 17:37:17 -04:00
rails_guides.rb Use frozen string literal in guides/ 2017-08-13 22:04:09 +09:00
w3c_validator.rb Use frozen string literal in guides/ 2017-08-13 22:04:09 +09:00