# encoding: utf-8

module Formtastic
  # @private
  module I18n

    DEFAULT_SCOPE = [:formtastic].freeze
    DEFAULT_VALUES = YAML.load_file(File.expand_path("../../locale/en.yml", __FILE__))["en"]["formtastic"].freeze
    SCOPES = [
        '%{model}.%{nested_model}.%{action}.%{attribute}',
        '%{model}.%{nested_model}.%{attribute}',
        '%{nested_model}.%{action}.%{attribute}',
        '%{nested_model}.%{attribute}',
        '%{model}.%{action}.%{attribute}',
        '%{model}.%{attribute}',
        '%{attribute}'
      ]

    class << self

      def translate(*args)
        key = args.shift.to_sym
        options = args.extract_options!
        options.reverse_merge!(:default => DEFAULT_VALUES[key])
        options[:scope] = [DEFAULT_SCOPE, options[:scope]].flatten.compact
        ::I18n.translate(key, *(args << options))
      end
      alias :t :translate

    end

  end
end

# encoding: utf-8

module Formtastic
  # @private
  module I18n

    DEFAULT_SCOPE = [:formtastic].freeze
    DEFAULT_VALUES = YAML.load_file(File.expand_path("../../locale/en.yml", __FILE__))["en"]["formtastic"].freeze
    SCOPES = [
        '%{model}.%{nested_model}.%{action}.%{attribute}',
        '%{model}.%{nested_model}.%{attribute}',
        '%{nested_model}.%{action}.%{attribute}',
        '%{nested_model}.%{attribute}',
        '%{model}.%{action}.%{attribute}',
        '%{model}.%{attribute}',
        '%{attribute}'
      ]

    class << self

      def translate(*args)
        key = args.shift.to_sym
        options = args.extract_options!
        options.reverse_merge!(:default => DEFAULT_VALUES[key])
        options[:scope] = [DEFAULT_SCOPE, options[:scope]].flatten.compact
        ::I18n.translate(key, *args, **options)
      end
      alias :t :translate

    end

  end
end

Remove ruby 2.7 deprecation warning
Remove ruby 2.7 deprecation warning

```
/path/to/formtastic-f95dddae2fe5/lib/formtastic/i18n.rb:26: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/path/to/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `translate' is defined here
```
