Module: Phlex::Rails::Helpers::Translate

Defined in:
lib/phlex/rails/helpers/translate.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



14
15
16
# File 'lib/phlex/rails/helpers/translate.rb', line 14

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

Instance Method Details

#translate(key) ⇒ Object Also known as: t



19
20
21
22
23
# File 'lib/phlex/rails/helpers/translate.rb', line 19

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

	view_context.t(key, **)
end