Internationalize error messages in Release services
The following discussion from !96586 (merged) should be addressed:
-
@tbulva started a discussion: (+2 comments) Question (non-blocking): I might be wrong but it seems to me like you are surfacing this error, and possibly the others here, on the front end. Shouldn't these be also internationalized?
Proposal
Internationalize the error messages in https://gitlab.com/gitlab-org/gitlab/-/tree/master/app/services/releases.
For example:
diff --git a/app/services/releases/create_service.rb b/app/services/releases/create_service.rb
index 2588d2187a50..dd626262f6e7 100644
--- a/app/services/releases/create_service.rb
+++ b/app/services/releases/create_service.rb
@@ -3,8 +3,8 @@
module Releases
class CreateService < Releases::BaseService
def execute
- return error('Access Denied', 403) unless allowed?
- return error('Release already exists', 409) if release
+ return error(_('Access Denied'), 403) unless allowed?
+ return error(_('Release already exists'), 409) if release
return error("Milestone(s) not found: #{inexistent_milestones.join(', ')}", 400) if inexistent_milestones.any?
# should be found before the creation of new tag
-
4 error messages in Releases::CreateService
-
2 error messages in Releases::DestroyService
-
5 error messages in Releases::UpdateService
Edited by Ahmed Hemdan