Skip to content
This repository
Browse code

add default options to Cascade#lookup

  • Loading branch information...
commit 0b9a1f2058a2be9543106cc19d08071c359511e1 1 parent 941ad9b
Sven Fuchs authored

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  lib/i18n/backend/cascade.rb
3  lib/i18n/backend/cascade.rb
@@ -38,9 +38,10 @@ module Cascade
38 38 def lookup(locale, key, scope = [], options = {})
39 39 return super unless cascade = options[:cascade]
40 40
  41 + cascade = { :step => 1 } unless cascade.is_a?(Hash)
41 42 separator = options[:separator] || I18n.default_separator
42 43 skip_root = cascade.has_key?(:skip_root) ? cascade[:skip_root] : true
43   - step = cascade[:step]
  44 + step = cascade[:step] || 1
44 45
45 46 keys = I18n.normalize_keys(nil, key, nil, separator)
46 47 offset = options[:cascade][:offset] || keys.length

0 comments on commit 0b9a1f2

Please sign in to comment.
Something went wrong with that request. Please try again.