diff options
-rw-r--r-- | app/helpers/services_helper.rb | 26 | ||||
-rw-r--r-- | app/models/service.rb | 25 | ||||
-rw-r--r-- | app/serializers/service_event_entity.rb | 2 | ||||
-rw-r--r-- | locale/gitlab.pot | 36 |
4 files changed, 53 insertions, 36 deletions
diff --git a/app/helpers/services_helper.rb b/app/helpers/services_helper.rb index a9d70522d9b..13d26166e6e 100644 --- a/app/helpers/services_helper.rb +++ b/app/helpers/services_helper.rb @@ -4,25 +4,29 @@ module ServicesHelper def service_event_description(event) case event when "push", "push_events" - "Event will be triggered by a push to the repository" + s_("ProjectService|Event will be triggered by a push to the repository") when "tag_push", "tag_push_events" - "Event will be triggered when a new tag is pushed to the repository" + s_("ProjectService|Event will be triggered when a new tag is pushed to the repository") when "note", "note_events" - "Event will be triggered when someone adds a comment" + s_("ProjectService|Event will be triggered when someone adds a comment") when "confidential_note", "confidential_note_events" - "Event will be triggered when someone adds a comment on a confidential issue" + s_("ProjectService|Event will be triggered when someone adds a comment on a confidential issue") when "issue", "issue_events" - "Event will be triggered when an issue is created/updated/closed" - when "confidential_issue", "confidential_issues_events" - "Event will be triggered when a confidential issue is created/updated/closed" + s_("ProjectService|Event will be triggered when an issue is created/updated/closed") + when "confidential_issue", "confidential_issue_events" + s_("ProjectService|Event will be triggered when a confidential issue is created/updated/closed") when "merge_request", "merge_request_events" - "Event will be triggered when a merge request is created/updated/merged" + s_("ProjectService|Event will be triggered when a merge request is created/updated/merged") when "pipeline", "pipeline_events" - "Event will be triggered when a pipeline status changes" + s_("ProjectService|Event will be triggered when a pipeline status changes") when "wiki_page", "wiki_page_events" - "Event will be triggered when a wiki page is created/updated" + s_("ProjectService|Event will be triggered when a wiki page is created/updated") when "commit", "commit_events" - "Event will be triggered when a commit is created/updated" + s_("ProjectService|Event will be triggered when a commit is created/updated") + when "deployment" + s_("ProjectService|Event will be triggered when a deployment finishes") + when "alert" + s_("ProjectService|Event will be triggered when a new, unique alert is recorded") end end diff --git a/app/models/service.rb b/app/models/service.rb index 49150e9d37e..04b30930d54 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -385,30 +385,7 @@ class Service < ApplicationRecord end def self.event_description(event) - case event - when "push", "push_events" - "Event will be triggered by a push to the repository" - when "tag_push", "tag_push_events" - "Event will be triggered when a new tag is pushed to the repository" - when "note", "note_events" - "Event will be triggered when someone adds a comment" - when "issue", "issue_events" - "Event will be triggered when an issue is created/updated/closed" - when "confidential_issue", "confidential_issue_events" - "Event will be triggered when a confidential issue is created/updated/closed" - when "merge_request", "merge_request_events" - "Event will be triggered when a merge request is created/updated/merged" - when "pipeline", "pipeline_events" - "Event will be triggered when a pipeline status changes" - when "wiki_page", "wiki_page_events" - "Event will be triggered when a wiki page is created/updated" - when "commit", "commit_events" - "Event will be triggered when a commit is created/updated" - when "deployment" - "Event will be triggered when a deployment finishes" - when "alert" - "Event will be triggered when a new, unique alert is recorded" - end + ServicesHelper.service_event_description(event) end def valid_recipients? diff --git a/app/serializers/service_event_entity.rb b/app/serializers/service_event_entity.rb index fd655dd1ed3..eb4f9c665f2 100644 --- a/app/serializers/service_event_entity.rb +++ b/app/serializers/service_event_entity.rb @@ -14,7 +14,7 @@ class ServiceEventEntity < Grape::Entity end expose :description do |event| - service.class.event_description(event) + ServicesHelper.service_event_description(event) end expose :field, if: -> (_, _) { event_field } do diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 3fac96de12c..b9e1e25a769 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -17452,6 +17452,42 @@ msgstr "" msgid "ProjectService|Comment" msgstr "" +msgid "ProjectService|Event will be triggered by a push to the repository" +msgstr "" + +msgid "ProjectService|Event will be triggered when a commit is created/updated" +msgstr "" + +msgid "ProjectService|Event will be triggered when a confidential issue is created/updated/closed" +msgstr "" + +msgid "ProjectService|Event will be triggered when a deployment finishes" +msgstr "" + +msgid "ProjectService|Event will be triggered when a merge request is created/updated/merged" +msgstr "" + +msgid "ProjectService|Event will be triggered when a new tag is pushed to the repository" +msgstr "" + +msgid "ProjectService|Event will be triggered when a new, unique alert is recorded" +msgstr "" + +msgid "ProjectService|Event will be triggered when a pipeline status changes" +msgstr "" + +msgid "ProjectService|Event will be triggered when a wiki page is created/updated" +msgstr "" + +msgid "ProjectService|Event will be triggered when an issue is created/updated/closed" +msgstr "" + +msgid "ProjectService|Event will be triggered when someone adds a comment" +msgstr "" + +msgid "ProjectService|Event will be triggered when someone adds a comment on a confidential issue" +msgstr "" + msgid "ProjectService|Perform common operations on GitLab project: %{project_name}" msgstr "" |