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.
15 16 17 18 |
# File 'lib/telegram/bot/updates_controller/translation.rb', line 15 def translate(key, = {}) key = "#{controller_path.tr('/', '.')}#{key}" if key.to_s.start_with?('.') I18n.translate(key, ) end |