From 6f3c65f6300f157e6ae5bfb839064383f3de11a9 Mon Sep 17 00:00:00 2001 From: Adam Prescott Date: Sat, 4 Apr 2015 12:46:45 -0400 Subject: Allow an array to be a default translation value. 4.2.1 introduced a change to the way `translate`/`t` works with an option of `default: [[]]`. In 4.2.0, this would give a default value of `[]`, but in 4.2.1, it leads to a missing translation. `default: [[]]` is again allowed for cases where a default of `[]` is needed. This addresses GitHub issue 19640. --- actionview/lib/action_view/helpers/translation_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionview/lib') diff --git a/actionview/lib/action_view/helpers/translation_helper.rb b/actionview/lib/action_view/helpers/translation_helper.rb index 29a0860c00..9d7390f1fd 100644 --- a/actionview/lib/action_view/helpers/translation_helper.rb +++ b/actionview/lib/action_view/helpers/translation_helper.rb @@ -41,7 +41,7 @@ module ActionView remaining_defaults = Array(options.delete(:default)).compact if has_default && !remaining_defaults.first.kind_of?(Symbol) - options[:default] = remaining_defaults.shift + options[:default] = remaining_defaults end # If the user has explicitly decided to NOT raise errors, pass that option to I18n. -- cgit v1.2.3