Skip to content

I18n overrides only work via the engine, not via Verifiable directly #3

Description

@JeremasPosta

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions