Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Commit

Permalink
add default options to Cascade#lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Fuchs committed Nov 1, 2010
1 parent 941ad9b commit 0b9a1f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/i18n/backend/cascade.rb
Expand Up @@ -38,9 +38,10 @@ module Cascade
def lookup(locale, key, scope = [], options = {})
return super unless cascade = options[:cascade]

cascade = { :step => 1 } unless cascade.is_a?(Hash)
separator = options[:separator] || I18n.default_separator
skip_root = cascade.has_key?(:skip_root) ? cascade[:skip_root] : true
step = cascade[:step]
step = cascade[:step] || 1

keys = I18n.normalize_keys(nil, key, nil, separator)
offset = options[:cascade][:offset] || keys.length
Expand Down

0 comments on commit 0b9a1f2

Please sign in to comment.