def lookup(locale, key, scope = [], options = {})
return unless key
separator = options[:separator] || I18n.default_separator
key = resolve_link(locale, key)
key = (Array(scope) + Array(key)).join(separator)
result = Translation.locale(locale).lookup(key, separator).all
if result.empty?
return nil
elsif result.first.key == key
return result.first.value
else
chop_range = (key.size + separator.size)..-1
result = result.inject({}) do |hash, r|
hash[r.key.slice(chop_range)] = r.value
hash
end
deep_symbolize_keys(unwind_keys(result, separator))
end
end