Skip to content

Commit

Permalink
Merge pull request #7 from annkissam/fix_for_deep_compile
Browse files Browse the repository at this point in the history
fix to support frozen hash modification
  • Loading branch information
shashank-sparinfosys authored Jan 23, 2024
2 parents b9cea98 + 5271891 commit 0ae2fe8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/i18n-recursive-lookup/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module I18n
module RecursiveLookup
VERSION = "0.0.5"
VERSION = "0.0.6"
end
end
1 change: 1 addition & 0 deletions lib/i18n/backend/recursive_lookup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def lookup(locale, key, scope = [], options = {})
#subject is hash or string
def deep_compile(locale, subject, options)
if subject.is_a?(Hash)
subject = subject.deep_dup if subject.frozen?
subject.each do |key, object|
subject[key], _had_to_compile_result = deep_compile(locale, object, options)
end
Expand Down

0 comments on commit 0ae2fe8

Please sign in to comment.