class Dragoman::TranslationVisitor
Public Class Methods
new(locale)
click to toggle source
Calls superclass method
# File lib/dragoman/translation_visitor.rb, line 4 def initialize locale @locale = locale super() end
Public Instance Methods
visit_LITERAL(node)
click to toggle source
# File lib/dragoman/translation_visitor.rb, line 9 def visit_LITERAL node translation = I18n.t node, scope: :routes, default: node.to_s, locale: @locale, fallback: true # NOTE: when fallback is true, fallbacks will NOT be used translation.present? ? translation : node end