Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Ruby 1.9.2: avoid Array#to_s and Array(nil)"

This reverts commit 7ad461b.
  • Loading branch information...
commit 7f0fcadd3650eaee5bd6a8ab8032ed3c5627385b 1 parent a038b3d
@jeremy jeremy authored
Showing with 4 additions and 13 deletions.
  1. +4 −13 activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb
View
17 activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb
@@ -195,19 +195,10 @@ def default_exception_handler(exception, locale, key, options)
# Merges the given locale, key and scope into a single array of keys.
# Splits keys that contain dots into multiple keys. Makes sure all
# keys are Symbols.
- def normalize_translation_keys(*keys)
- normalized = []
- keys.each do |key|
- case key
- when Array
- normalized.concat normalize_translation_keys(*key)
- when nil
- # skip
- else
- normalized.concat key.to_s.split('.').map { |sub| sub.to_sym }
- end
- end
- normalized
+ def normalize_translation_keys(locale, key, scope)
+ keys = [locale] + Array(scope) + [key]
+ keys = keys.map { |k| k.to_s.split(/\./) }
+ keys.flatten.map { |k| k.to_sym }
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.