Commit 7b9756c3 authored by Mark Chao's avatar Mark Chao

Merge branch '323056-translate-locales-in-dast-services' into 'master'

Translate strings in DAST related services

See merge request gitlab-org/gitlab!59851
parents 29e7ec58 3716ab28
......@@ -8,13 +8,13 @@ module DastScannerProfiles
return unauthorized unless can_delete_scanner_profile?
dast_scanner_profile = find_dast_scanner_profile(id)
return ServiceResponse.error(message: "Scanner profile not found for given parameters") unless dast_scanner_profile
return ServiceResponse.error(message: "Cannot delete #{dast_scanner_profile.name} referenced in security policy") if referenced_in_security_policy?(dast_scanner_profile)
return ServiceResponse.error(message: _('Scanner profile not found for given parameters')) unless dast_scanner_profile
return ServiceResponse.error(message: _('Cannot delete %{profile_name} referenced in security policy') % { profile_name: dast_scanner_profile.name }) if referenced_in_security_policy?(dast_scanner_profile)
if dast_scanner_profile.destroy
ServiceResponse.success(payload: dast_scanner_profile)
else
ServiceResponse.error(message: 'Scanner profile failed to delete')
ServiceResponse.error(message: _('Scanner profile failed to delete'))
end
end
......
......@@ -8,8 +8,8 @@ module DastScannerProfiles
return unauthorized unless can_update_scanner_profile?
dast_scanner_profile = find_dast_scanner_profile(id)
return ServiceResponse.error(message: "Scanner profile not found for given parameters") unless dast_scanner_profile
return ServiceResponse.error(message: "Cannot modify #{dast_scanner_profile.name} referenced in security policy") if referenced_in_security_policy?(dast_scanner_profile)
return ServiceResponse.error(message: _('Scanner profile not found for given parameters')) unless dast_scanner_profile
return ServiceResponse.error(message: _('Cannot modify %{profile_name} referenced in security policy') % { profile_name: dast_scanner_profile.name }) if referenced_in_security_policy?(dast_scanner_profile)
update_args = {
name: profile_name,
......
......@@ -13,7 +13,7 @@ module DastSiteProfiles
attr_reader :dast_site_profile
def execute(name:, target_url:, **params)
return ServiceResponse.error(message: 'Insufficient permissions') unless allowed?
return ServiceResponse.error(message: _('Insufficient permissions')) unless allowed?
ActiveRecord::Base.transaction do
dast_site = DastSites::FindOrCreateService.new(project, current_user).execute!(url: target_url)
......
......@@ -8,13 +8,13 @@ module DastSiteProfiles
return unauthorized unless can_delete_site_profile?
dast_site_profile = find_dast_site_profile(id)
return ServiceResponse.error(message: "Site profile not found for given parameters") unless dast_site_profile
return ServiceResponse.error(message: "Cannot delete #{dast_site_profile.name} referenced in security policy") if referenced_in_security_policy?(dast_site_profile)
return ServiceResponse.error(message: _('Site profile not found for given parameters')) unless dast_site_profile
return ServiceResponse.error(message: _('Cannot delete %{profile_name} referenced in security policy') % { profile_name: dast_site_profile.name }) if referenced_in_security_policy?(dast_site_profile)
if dast_site_profile.destroy
ServiceResponse.success(payload: dast_site_profile)
else
ServiceResponse.error(message: 'Site profile failed to delete')
ServiceResponse.error(message: _('Site profile failed to delete'))
end
end
......
......@@ -13,11 +13,11 @@ module DastSiteProfiles
attr_reader :dast_site_profile
def execute(id:, **params)
return ServiceResponse.error(message: 'Insufficient permissions') unless allowed?
return ServiceResponse.error(message: _('Insufficient permissions')) unless allowed?
find_dast_site_profile!(id)
return ServiceResponse.error(message: "Cannot modify #{dast_site_profile.name} referenced in security policy") if referenced_in_security_policy?
return ServiceResponse.error(message: _('Cannot modify %{profile_name} referenced in security policy') % { profile_name: dast_site_profile.name }) if referenced_in_security_policy?
ActiveRecord::Base.transaction do
if target_url = params.delete(:target_url)
......@@ -36,7 +36,7 @@ module DastSiteProfiles
rescue Rollback => e
ServiceResponse.error(message: e.errors)
rescue ActiveRecord::RecordNotFound => e
ServiceResponse.error(message: "#{e.model} not found")
ServiceResponse.error(message: _('%{model_name} not found') % { model_name: e.model })
rescue ActiveRecord::RecordInvalid => e
ServiceResponse.error(message: e.record.errors.full_messages)
end
......
......@@ -691,6 +691,9 @@ msgstr ""
msgid "%{milliseconds}ms"
msgstr ""
msgid "%{model_name} not found"
msgstr ""
msgid "%{mrText}, this issue will be closed automatically."
msgstr ""
......@@ -5786,6 +5789,9 @@ msgstr ""
msgid "Cannot create the abuse report. This user has been blocked."
msgstr ""
msgid "Cannot delete %{profile_name} referenced in security policy"
msgstr ""
msgid "Cannot enable shared runners because parent group does not allow it"
msgstr ""
......@@ -5807,6 +5813,9 @@ msgstr ""
msgid "Cannot merge"
msgstr ""
msgid "Cannot modify %{profile_name} referenced in security policy"
msgstr ""
msgid "Cannot modify managed Kubernetes cluster"
msgstr ""
......@@ -17185,6 +17194,9 @@ msgstr ""
msgid "Instance overview"
msgstr ""
msgid "Insufficient permissions"
msgstr ""
msgid "Integration"
msgstr ""
......@@ -27661,6 +27673,12 @@ msgstr ""
msgid "Scanner"
msgstr ""
msgid "Scanner profile failed to delete"
msgstr ""
msgid "Scanner profile not found for given parameters"
msgstr ""
msgid "Schedule a new pipeline"
msgstr ""
......@@ -29310,6 +29328,12 @@ msgstr ""
msgid "Single or combined queries"
msgstr ""
msgid "Site profile failed to delete"
msgstr ""
msgid "Site profile not found for given parameters"
msgstr ""
msgid "Size"
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