Commit 23b28e68 authored by Marcos Rocha's avatar Marcos Rocha Committed by James Fargher

Annotate DAST Service object strings for localization

parent b05150f7
......@@ -5,7 +5,7 @@ module AppSec
module Profiles
class BuildConfigService < BaseProjectService
def execute
return ServiceResponse.error(message: 'Insufficient permissions for dast_configuration keyword') unless allowed?
return ServiceResponse.error(message: _('Insufficient permissions for dast_configuration keyword')) unless allowed?
build_config = { dast_site_profile: site_profile, dast_scanner_profile: scanner_profile }
......@@ -42,7 +42,7 @@ module AppSec
profile = yield(name).execute.first
unless can?(current_user, :read_on_demand_dast_scan, profile)
errors.push("DAST profile not found: #{name}")
errors.push(_('DAST profile not found: %{name}') % { name: name })
return
end
......
......@@ -5,7 +5,7 @@ module AppSec
module Profiles
class CreateService < BaseContainerService
def execute
return ServiceResponse.error(message: 'Insufficient permissions') unless allowed?
return ServiceResponse.error(message: _('Insufficient permissions')) unless allowed?
ApplicationRecord.transaction do
@dast_profile = create_profile
......@@ -89,7 +89,7 @@ module AppSec
author: current_user,
scope: container,
target: dast_profile,
message: "Added DAST profile"
message: 'Added DAST profile'
)
if schedule
......
......@@ -6,8 +6,8 @@ module AppSec
class DestroyService < BaseContainerService
def execute
return unauthorized unless allowed?
return ServiceResponse.error(message: 'Profile parameter missing') unless dast_profile
return ServiceResponse.error(message: 'Profile failed to delete') unless dast_profile.destroy
return ServiceResponse.error(message: _('Profile parameter missing')) unless dast_profile
return ServiceResponse.error(message: _('Profile failed to delete')) unless dast_profile.destroy
create_audit_event
......@@ -22,7 +22,7 @@ module AppSec
def unauthorized
ServiceResponse.error(
message: 'You are not authorized to update this profile',
message: _('You are not authorized to update this profile'),
http_status: 403
)
end
......@@ -37,7 +37,7 @@ module AppSec
author: current_user,
scope: container,
target: dast_profile,
message: "Removed DAST profile"
message: 'Removed DAST profile'
)
end
end
......
......@@ -8,7 +8,7 @@ module AppSec
def execute
return unauthorized unless allowed?
return error('Profile parameter missing') unless dast_profile
return error(_('Profile parameter missing')) unless dast_profile
build_auditors!
......@@ -79,7 +79,7 @@ module AppSec
end
def unauthorized
error('You are not authorized to update this profile', http_status: 403)
error(_('You are not authorized to update this profile'), http_status: 403)
end
def dast_profile
......
......@@ -10304,6 +10304,9 @@ msgstr ""
msgid "DAST Scans"
msgstr ""
msgid "DAST profile not found: %{name}"
msgstr ""
msgid "DNS"
msgstr ""
......@@ -18308,6 +18311,9 @@ msgstr ""
msgid "Insufficient permissions"
msgstr ""
msgid "Insufficient permissions for dast_configuration keyword"
msgstr ""
msgid "Integration"
msgstr ""
......@@ -26080,12 +26086,18 @@ msgstr ""
msgid "Profile Settings"
msgstr ""
msgid "Profile failed to delete"
msgstr ""
msgid "Profile image guideline"
msgstr ""
msgid "Profile page:"
msgstr ""
msgid "Profile parameter missing"
msgstr ""
msgid "ProfileSession|on"
msgstr ""
......@@ -38931,6 +38943,9 @@ msgstr ""
msgid "You are not authorized to perform this action"
msgstr ""
msgid "You are not authorized to update this profile"
msgstr ""
msgid "You are not authorized to update this scanner profile"
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