Module: Phlex::Translation

Defined in:
lib/phlex/translation.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(view) ⇒ Object



5
6
7
# File 'lib/phlex/translation.rb', line 5

def self.included(view)
	view.extend(ClassMethods)
end

Instance Method Details

#translate(key, **options) ⇒ Object



17
18
19
20
21
# File 'lib/phlex/translation.rb', line 17

def translate(key, **options)
	key = "#{self.class.translation_path}#{key}" if key.start_with?(".")

	::I18n.translate(key, **options)
end