Skip to content

Commit

Permalink
Fix symbol translation test; invoke with start_with? (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspth authored Mar 5, 2023
1 parent 65693b8 commit c7502a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/nice_partials/monkey_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def capture(*, &block)
end

def t(key, options = {})
if (prefix = @_nice_partials_t_prefix) && key.to_s.first == '.'
if (prefix = @_nice_partials_t_prefix) && key&.start_with?(".")
key = "#{prefix}#{key}"
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<%= render("basic") do |partial| %>
<%= partial.message.t :message %>
<% end %>
<%= t(:message, scope: "translations.nice_partials_translated_symbol") %>

0 comments on commit c7502a4

Please sign in to comment.