Module: Telegram::Bot::UpdatesController::Translation::ClassMethods

Defined in:
lib/telegram/bot/updates_controller/translation.rb

Instance Method Summary collapse

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, **options)
  key = "#{controller_path.tr('/', '.')}#{key}" if key.to_s.start_with?('.')
  I18n.translate(key, **options)
end