Sha256: a3aaa83130d5904ffe7085259278d23699e5f3eb26365af85f5debe8bcfc3f84
Contents?: true
Size: 463 Bytes
Versions: 5
Compression:
Stored size: 463 Bytes
Contents
require 'i18n' require 'dry/validation/messages/abstract' module Dry module Validation class Messages::I18n < Messages::Abstract attr_reader :t ::I18n.load_path.concat(config.paths) def initialize @t = I18n.method(:t) end def get(key, options = {}) t.(key, options) end def key?(key, options) ::I18n.exists?(key, options.fetch(:locale, I18n.default_locale)) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems