Skip to content

Commit

Permalink
Merge branch '2.x' into 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Lobster committed Oct 31, 2019
2 parents 7b91e1a + 249c8d3 commit ea97253
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/redmine_zulip/issue_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def zulip_api
end

def notify_assignment
locale = assigned_to.language
locale = assigned_to.language.present? ?
assigned_to.language : Setting.default_language
message = I18n.t("zulip_notify_assignment", {
locale: locale,
user: User.current.name,
Expand Down Expand Up @@ -141,12 +142,15 @@ def notify_unassignment
previous_assigned_to = User.find(
previous_changes["assigned_to_id"].first
)
locale = previous_assigned_to.language.present? ?
previous_assigned_to.language : Setting.default_language
message = I18n.t("zulip_notify_unassignment", {
user: User.current.name,
id: id,
url: url,
project: project.name,
subject: subject_without_punctuation
subject: subject_without_punctuation,
locale: locale
})
zulip_api.messages.send(
type: "private",
Expand All @@ -156,7 +160,8 @@ def notify_unassignment
end

def notify_assigned_to_issue_updated
locale = assigned_to.language
locale = assigned_to.language.present? ?
assigned_to.language : Setting.default_language
message = I18n.t("zulip_notify_updated", {
user: User.current.name,
id: id,
Expand Down Expand Up @@ -216,7 +221,8 @@ def notify_assigned_to_issue_updated
end

def notify_assigned_to_issue_destroyed
locale = assigned_to.language
locale = assigned_to.language.present? ?
assigned_to.language : Setting.default_language
message = I18n.t("zulip_notify_destroyed", {
user: User.current.name,
id: id,
Expand Down

0 comments on commit ea97253

Please sign in to comment.