summaryrefslogtreecommitdiff
path: root/lib/saml/kit/concerns/translatable.rb
blob: 38e94bac3c291184b82574a7a531e4fd29e4c412 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

module Saml
  module Kit
    # This module is responsible
    # for translating error messages
    # to the current locale.
    module Translatable
      # @!visibility private
      def error_message(attribute, options = {})
        default_options = { scope: "saml/kit.errors.#{name}" }
        I18n.translate(attribute, **default_options.merge(options))
      end
    end
  end
end