I am using Trailblazer 2.1 (and dry-validation (0.11.1) consequently) in a Rails 5 project.
I have 2 different language locales bound to the user profile.
When I dynamically change the user's locale - dry-validation does not notice it - and keeps yielding the validation errors with a former locale.
What's wrong? Is this or bug or a feature? Why doesn't dry-validation respond to the locale change? How to fix it?
Here's my locale switching code:
class ApplicationController < ActionController::Base
before_action :switch_locale
def switch_locale
I18n.locale = current_user.locale
end
end