Prefer string interpolation to concatenation

This commit is contained in:
Andy Allan 2020-10-28 17:15:14 +01:00
parent 9690ef737c
commit 52c688f55a
5 changed files with 21 additions and 8 deletions

View file

@ -3,11 +3,11 @@ module NoteHelper
def note_event(event, at, by)
if by.nil?
t("browse.note." + event + "_by_anonymous_html",
t("browse.note.#{event}_by_anonymous_html",
:when => friendly_date_ago(at),
:exact_time => l(at))
else
t("browse.note." + event + "_by_html",
t("browse.note.#{event}_by_html",
:when => friendly_date_ago(at),
:exact_time => l(at),
:user => note_author(by))

View file

@ -6,7 +6,7 @@ module TitleHelper
def set_title(title = nil)
if title
@title = TitleHelper.coder.decode(title.gsub("<bdi>", "\u202a").gsub("</bdi>", "\u202c"))
response.headers["X-Page-Title"] = ERB::Util.u(@title + " | " + t("layouts.project_name.title"))
response.headers["X-Page-Title"] = ERB::Util.u("#{@title} | #{t('layouts.project_name.title')}")
else
@title = title
response.headers["X-Page-Title"] = ERB::Util.u(t("layouts.project_name.title"))