-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix t prefixes not being assigned properly This fixes a change I made to our t-prefixes that broke things: overriding `ActionView::Base#capture` meant that we'd fire on helper calls too — and extract from their block location. Note: we're leveraging Rails 6.1+'s `@current_template.virtual_path` to avoid needing to muck with block source_locations or view_paths, Rails has already figured that out for us. * Freeze two "." string literals `t` might be called often on a page and in a nested loop these needless String allocations could add up. Since they're so easy to fix, let's do it.
- Loading branch information
Showing
5 changed files
with
42 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
test/fixtures/translations/_nice_partials_translated.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<%= render("basic") do |partial| %> | ||
<%= partial.message.t ".message" %> | ||
<%= render "basic" do %> | ||
<% _1.message.t ".message" %> | ||
<% end %> |
6 changes: 6 additions & 0 deletions
6
test/fixtures/translations/_nice_partials_translated_nested.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<%= render "basic" do %> | ||
<% _1.message render("translations/translated") %> | ||
<% _1.message do %> | ||
<%= render "translations/translated" %> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters