From ff3c06f718a80c5d943e93e3cb1c784911d5c423 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Thu, 15 Jun 2017 01:06:04 +0530 Subject: Allow translate default option to accept an array similar to i18n.t. Fixes #29441 --- actionpack/lib/abstract_controller/translation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/abstract_controller/translation.rb b/actionpack/lib/abstract_controller/translation.rb index 9e3858802a..e4ac95df50 100644 --- a/actionpack/lib/abstract_controller/translation.rb +++ b/actionpack/lib/abstract_controller/translation.rb @@ -13,7 +13,7 @@ module AbstractController path = controller_path.tr("/", ".") defaults = [:"#{path}#{key}"] defaults << options[:default] if options[:default] - options[:default] = defaults + options[:default] = defaults.flatten key = "#{path}.#{action_name}#{key}" end I18n.translate(key, options) -- cgit v1.2.3