diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-08-29 02:45:05 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-08-29 02:45:05 +0300 |
commit | b34120336d33e57d9817559f82771f8da4f5f2b3 (patch) | |
tree | ad5a40a26d53df99273a2e1221bc1f685c2b0bda /app | |
parent | 7225162f30d0cbdefddba802f84e19d55d46da94 (diff) | |
parent | 057df5a3f4f828fab9c0c2de08b0e53e424b99f7 (diff) |
Merge branch '63262-notes-are-persisted-with-the-user-s-locale' into 'master'
Resolve "Notes are persisted with the user's locale"
See merge request gitlab-org/gitlab-ce!32264
Diffstat (limited to 'app')
-rw-r--r-- | app/services/system_note_service.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index ee7223d6349..1b48b20e28b 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -67,7 +67,7 @@ module SystemNoteService create_note(NoteSummary.new(noteable, project, author, body, action: 'assignee')) end - # Called when the assignees of an Issue is changed or removed + # Called when the assignees of an issuable is changed or removed # # issuable - Issuable object (responds to assignees) # project - Project owning noteable @@ -88,10 +88,12 @@ module SystemNoteService def change_issuable_assignees(issuable, project, author, old_assignees) unassigned_users = old_assignees - issuable.assignees added_users = issuable.assignees.to_a - old_assignees - text_parts = [] - text_parts << "assigned to #{added_users.map(&:to_reference).to_sentence}" if added_users.any? - text_parts << "unassigned #{unassigned_users.map(&:to_reference).to_sentence}" if unassigned_users.any? + + Gitlab::I18n.with_default_locale do + text_parts << "assigned to #{added_users.map(&:to_reference).to_sentence}" if added_users.any? + text_parts << "unassigned #{unassigned_users.map(&:to_reference).to_sentence}" if unassigned_users.any? + end body = text_parts.join(' and ') |