Extend in-app Dry::Validation::Contract classes too use their slice's i18n backend
Author: timrileyCreated Jul 6, 2026Updated Jul 6, 2026
Reported in chat, with the following shared as a working snippet:
# demo/app/contract.rb
require "refinements/pathname"
module Demo
class Contract < Dry::Validation::Contract
using Refinements::Pathname
config.messages.backend = :i18n
config.messages.load_paths.merge Hanami.app.root.join("config/i18n").files("*.yml")
end
endSource: hanami/hanami