Sha256: b24e87a45153abdca570af442476475a9cd0a38b11fcea4aff7aa56b7eef092b

Contents?: true

Size: 452 Bytes

Versions: 10

Compression:

Stored size: 452 Bytes

Contents

# frozen_string_literal: true

module Authlogic
  module I18n
    # The default translator used by authlogic/i18n.rb
    class Translator
      # If the I18n gem is present, calls +I18n.translate+ passing all
      # arguments, else returns +options[:default]+.
      def translate(key, options = {})
        if defined?(::I18n)
          ::I18n.translate key, **options
        else
          options[:default]
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
authlogic-6.4.3 lib/authlogic/i18n/translator.rb
authlogic-nicho-6.6 lib/authlogic/i18n/translator.rb
authlogic-nicho-6.5 lib/authlogic/i18n/translator.rb
authlogic-6.4.2 lib/authlogic/i18n/translator.rb
authlogic-6.4.1 lib/authlogic/i18n/translator.rb
authlogic-6.4.0 lib/authlogic/i18n/translator.rb
authlogic-6.3.0 lib/authlogic/i18n/translator.rb
authlogic-6.2.0 lib/authlogic/i18n/translator.rb
authlogic-6.1.0 lib/authlogic/i18n/translator.rb
authlogic-6.0.0 lib/authlogic/i18n/translator.rb