Module: Telegram::Bot::UpdatesController::Translation::ClassMethods
- Defined in:
- lib/telegram/bot/updates_controller/translation.rb
Instance Method Summary collapse
-
#translate(key, **options) ⇒ Object
(also: #t)
Class-level helper for lazy translations.
Instance Method Details
#translate(key, **options) ⇒ Object Also known as: t
Class-level helper for lazy translations.
17 18 19 20 |
# File 'lib/telegram/bot/updates_controller/translation.rb', line 17 def translate(key, **) key = "#{controller_path.tr('/', '.')}#{key}" if key.to_s.start_with?('.') I18n.translate(key, **) end |