lib/titlezilla/translator.rb in titlezilla-0.1.0 vs lib/titlezilla/translator.rb in titlezilla-0.1.1
- old
+ new
@@ -8,15 +8,19 @@
@namespace, @controller_name = parse_namespace_and_controller_name(controller_path)
@action_name = action_name.to_s.freeze
@context = context
end
- def title
- lookup(controller_name, map(action_name))
+ def title(override = nil)
+ if !override
+ @title ||= lookup(controller_name, map(action_name))
+ else
+ @title = override
+ end
end
def application_title
- lookup('application')
+ @application_title ||= lookup('application')
end
def meta_title
[title, application_title].compact.join(::Titlezilla.configuration.separator)
end