Sha256: 8337a7979258320e923affd7015ac8e0d93b4182cb128cf44322fc8490dfd1fc
Contents?: true
Size: 1007 Bytes
Versions: 19
Compression:
Stored size: 1007 Bytes
Contents
= Translate with i18n gem Rodauth allows transforming user-facing text configuration such as flash messages, validation errors, labels etc. via the +translate+ configuration method. This method receives a name of a configuration along with its default value, and is expected to return the result text. You can use this to perform translations using the {i18n gem}[https://github.com/ruby-i18n/i18n]: plugin :rodauth do enable :login, :logout, :reset_password translate do |key, default| I18n.translate("rodauth.#{key}") || default end end Your translation file may then look something like this: en: rodauth: login_notice_flash: "You have been signed in" require_login_error_flash: "Login is required for accessing this page" no_matching_login_message: "user with this email address doesn't exist" reset_password_email_subject: "Password Reset Instructions" Alternatively, you can use the {rodauth-i18n}[https://github.com/janko/rodauth-i18n] gem.
Version data entries
19 entries across 19 versions & 1 rubygems