Commit 9bfc902e authored by Gabriel Mazetto's avatar Gabriel Mazetto

Merge branch '219958-translate-service-text' into 'master'

Move Service description text to helper & translate

Closes #219958

See merge request gitlab-org/gitlab!34037
parents d04c20ea 303aa3a9
...@@ -4,25 +4,29 @@ module ServicesHelper ...@@ -4,25 +4,29 @@ module ServicesHelper
def service_event_description(event) def service_event_description(event)
case event case event
when "push", "push_events" 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" 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" 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" 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" when "issue", "issue_events"
"Event will be triggered when an issue is created/updated/closed" s_("ProjectService|Event will be triggered when an issue is created/updated/closed")
when "confidential_issue", "confidential_issues_events" when "confidential_issue", "confidential_issue_events"
"Event will be triggered when a confidential issue is created/updated/closed" s_("ProjectService|Event will be triggered when a confidential issue is created/updated/closed")
when "merge_request", "merge_request_events" 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" 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" 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" 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
end end
......
...@@ -385,30 +385,7 @@ class Service < ApplicationRecord ...@@ -385,30 +385,7 @@ class Service < ApplicationRecord
end end
def self.event_description(event) def self.event_description(event)
case event ServicesHelper.service_event_description(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
end end
def valid_recipients? def valid_recipients?
......
...@@ -14,7 +14,7 @@ class ServiceEventEntity < Grape::Entity ...@@ -14,7 +14,7 @@ class ServiceEventEntity < Grape::Entity
end end
expose :description do |event| expose :description do |event|
service.class.event_description(event) ServicesHelper.service_event_description(event)
end end
expose :field, if: -> (_, _) { event_field } do expose :field, if: -> (_, _) { event_field } do
......
...@@ -17452,6 +17452,42 @@ msgstr "" ...@@ -17452,6 +17452,42 @@ msgstr ""
msgid "ProjectService|Comment" msgid "ProjectService|Comment"
msgstr "" 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}" msgid "ProjectService|Perform common operations on GitLab project: %{project_name}"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment