Skip to content

Commit

Permalink
I18n.translate takes kwargs options
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda authored and byroot committed Dec 11, 2019
1 parent 6d12d9d commit 4c0bfdd
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ def i18n_format_options
options
end

def translate_number_value_with_default(key, i18n_options = {})
I18n.translate(key, { default: default_value(key), scope: :number }.merge!(i18n_options))
def translate_number_value_with_default(key, **i18n_options)
I18n.translate(key, **{default: default_value(key), scope: :number}.merge!(i18n_options))
end

def translate_in_locale(key, i18n_options = {})
translate_number_value_with_default(key, { locale: options[:locale] }.merge(i18n_options))
def translate_in_locale(key, **i18n_options)
translate_number_value_with_default(key, **{locale: options[:locale]}.merge(i18n_options))
end

def default_value(key)
Expand Down

0 comments on commit 4c0bfdd

Please sign in to comment.