aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-11-09 04:05:22 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2009-11-09 04:05:22 -0800
commit7f0fcadd3650eaee5bd6a8ab8032ed3c5627385b (patch)
tree28c74d3262ffd5c93fa12fb157044ce2b350ec4c
parenta038b3d1bc20ba225bf8a7672478300f60a41e77 (diff)
downloadrails-7f0fcadd3650eaee5bd6a8ab8032ed3c5627385b.tar.gz
rails-7f0fcadd3650eaee5bd6a8ab8032ed3c5627385b.tar.bz2
rails-7f0fcadd3650eaee5bd6a8ab8032ed3c5627385b.zip
Revert "Ruby 1.9.2: avoid Array#to_s and Array(nil)"
This reverts commit 7ad461b44dabb586fbad190493ac4ecd96104597.
-rwxr-xr-xactivesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb17
1 files changed, 4 insertions, 13 deletions
diff --git a/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb b/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb
index 7487b96b8c..1b49debc05 100755
--- a/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb
+++ b/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb
@@ -195,19 +195,10 @@ module I18n
# 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