The README says:
All messages are stored in config/locales/en.yml and can be overridden in your application's locale files.
This isn't accurate for apps that use Verifiable directly (i.e. record.send_sms_code).
Verifier hardcodes English strings in every result builder method (rate_limited_result, locked_result, code_not_found_result, etc.) and never calls I18n.t. Locale overrides only work because VerificationsController (the engine) calls I18n.t("verify_it.errors.#{result.error}") itself.
So if you mount the engine — overrides work. If you call send_sms_code directly — result.message is always the hardcoded English string, locale files are ignored.
Expected: Verifier calls I18n.t when building messages, so overrides work regardless of how the gem is used.
Workaround for now: map result.error (the symbol) to your own I18n.t call in the caller.
The README says:
This isn't accurate for apps that use
Verifiabledirectly (i.e.record.send_sms_code).Verifierhardcodes English strings in every result builder method (rate_limited_result,locked_result,code_not_found_result, etc.) and never callsI18n.t. Locale overrides only work becauseVerificationsController(the engine) callsI18n.t("verify_it.errors.#{result.error}")itself.So if you mount the engine — overrides work. If you call
send_sms_codedirectly —result.messageis always the hardcoded English string, locale files are ignored.Expected:
VerifiercallsI18n.twhen building messages, so overrides work regardless of how the gem is used.Workaround for now: map
result.error(the symbol) to your ownI18n.tcall in the caller.