summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
Diffstat (limited to 'app/services')
-rw-r--r--app/services/base_count_service.rb4
-rw-r--r--app/services/clusters/create_service.rb2
-rw-r--r--app/services/clusters/gcp/finalize_creation_service.rb2
-rw-r--r--app/services/concerns/exclusive_lease_guard.rb2
-rw-r--r--app/services/files/delete_service.rb2
-rw-r--r--app/services/files/update_service.rb2
-rw-r--r--app/services/groups/create_service.rb4
-rw-r--r--app/services/groups/nested_create_service.rb2
-rw-r--r--app/services/groups/transfer_service.rb10
-rw-r--r--app/services/import/github_service.rb2
-rw-r--r--app/services/issues/move_service.rb4
-rw-r--r--app/services/lfs/lock_file_service.rb2
-rw-r--r--app/services/members/create_service.rb2
-rw-r--r--app/services/merge_requests/merge_service.rb6
-rw-r--r--app/services/merge_requests/squash_service.rb4
-rw-r--r--app/services/milestones/promote_service.rb4
-rw-r--r--app/services/notification_recipient_service.rb6
-rw-r--r--app/services/projects/batch_count_service.rb4
-rw-r--r--app/services/projects/count_service.rb4
-rw-r--r--app/services/projects/create_service.rb2
-rw-r--r--app/services/projects/destroy_service.rb10
-rw-r--r--app/services/projects/import_service.rb4
-rw-r--r--app/services/projects/lfs_pointers/lfs_import_service.rb4
-rw-r--r--app/services/projects/transfer_service.rb4
-rw-r--r--app/services/projects/update_pages_service.rb14
-rw-r--r--app/services/projects/update_service.rb6
-rw-r--r--app/services/quick_actions/interpret_service.rb22
-rw-r--r--app/services/submodules/update_service.rb4
-rw-r--r--app/services/test_hooks/project_service.rb14
-rw-r--r--app/services/test_hooks/system_service.rb2
30 files changed, 77 insertions, 77 deletions
diff --git a/app/services/base_count_service.rb b/app/services/base_count_service.rb
index ad1647842b8..2a73a69542e 100644
--- a/app/services/base_count_service.rb
+++ b/app/services/base_count_service.rb
@@ -6,7 +6,7 @@ class BaseCountService
def relation_for_count
raise(
NotImplementedError,
- '"relation_for_count" must be implemented and return an ActiveRecord::Relation'
+ _('"relation_for_count" must be implemented and return an ActiveRecord::Relation')
)
end
@@ -35,7 +35,7 @@ class BaseCountService
end
def cache_key
- raise NotImplementedError, 'cache_key must be implemented and return a String'
+ raise NotImplementedError, _('cache_key must be implemented and return a String')
end
# subclasses can override to add any specific options, such as
diff --git a/app/services/clusters/create_service.rb b/app/services/clusters/create_service.rb
index 5a9da053780..83269dfc78b 100644
--- a/app/services/clusters/create_service.rb
+++ b/app/services/clusters/create_service.rb
@@ -9,7 +9,7 @@ module Clusters
end
def execute(access_token: nil)
- raise ArgumentError, 'Unknown clusterable provided' unless clusterable
+ raise ArgumentError, _('Unknown clusterable provided') unless clusterable
raise ArgumentError, _('Instance does not support multiple Kubernetes clusters') unless can_create_cluster?
cluster_params = params.merge(user: current_user).merge(clusterable_params)
diff --git a/app/services/clusters/gcp/finalize_creation_service.rb b/app/services/clusters/gcp/finalize_creation_service.rb
index 5525c1b9b7f..1993c77802f 100644
--- a/app/services/clusters/gcp/finalize_creation_service.rb
+++ b/app/services/clusters/gcp/finalize_creation_service.rb
@@ -77,7 +77,7 @@ module Clusters
end
def build_kube_client!(api_url, ca_pem, username, password)
- raise "Incomplete settings" unless api_url && username && password
+ raise _("Incomplete settings") unless api_url && username && password
Gitlab::Kubernetes::KubeClient.new(
api_url,
diff --git a/app/services/concerns/exclusive_lease_guard.rb b/app/services/concerns/exclusive_lease_guard.rb
index f102e00d150..03e8cecc723 100644
--- a/app/services/concerns/exclusive_lease_guard.rb
+++ b/app/services/concerns/exclusive_lease_guard.rb
@@ -16,7 +16,7 @@ module ExclusiveLeaseGuard
lease = exclusive_lease.try_obtain
unless lease
- log_error('Cannot obtain an exclusive lease. There must be another instance already in execution.')
+ log_error(_('Cannot obtain an exclusive lease. There must be another instance already in execution.'))
return
end
diff --git a/app/services/files/delete_service.rb b/app/services/files/delete_service.rb
index 0ec1f79d396..f47eb4fccd4 100644
--- a/app/services/files/delete_service.rb
+++ b/app/services/files/delete_service.rb
@@ -20,7 +20,7 @@ module Files
super
if file_has_changed?(@file_path, @last_commit_sha)
- raise FileChangedError, "You are attempting to delete a file that has been previously updated."
+ raise FileChangedError, _("You are attempting to delete a file that has been previously updated.")
end
end
end
diff --git a/app/services/files/update_service.rb b/app/services/files/update_service.rb
index 2b3e96e6c53..b4750b386d4 100644
--- a/app/services/files/update_service.rb
+++ b/app/services/files/update_service.rb
@@ -19,7 +19,7 @@ module Files
super
if file_has_changed?(@file_path, @last_commit_sha)
- raise FileChangedError, "You are attempting to update a file that has changed since you started editing it."
+ raise FileChangedError, _("You are attempting to update a file that has changed since you started editing it.")
end
end
end
diff --git a/app/services/groups/create_service.rb b/app/services/groups/create_service.rb
index 24d8400c625..275bf69fff7 100644
--- a/app/services/groups/create_service.rb
+++ b/app/services/groups/create_service.rb
@@ -38,13 +38,13 @@ module Groups
if @group.subgroup?
unless can?(current_user, :create_subgroup, @group.parent)
@group.parent = nil
- @group.errors.add(:parent_id, 'You don’t have permission to create a subgroup in this group.')
+ @group.errors.add(:parent_id, _('You don’t have permission to create a subgroup in this group.'))
return false
end
else
unless can?(current_user, :create_group)
- @group.errors.add(:base, 'You don’t have permission to create groups.')
+ @group.errors.add(:base, _('You don’t have permission to create groups.'))
return false
end
diff --git a/app/services/groups/nested_create_service.rb b/app/services/groups/nested_create_service.rb
index f01f5656296..f9492def58e 100644
--- a/app/services/groups/nested_create_service.rb
+++ b/app/services/groups/nested_create_service.rb
@@ -19,7 +19,7 @@ module Groups
end
if group_path.include?('/') && !Group.supports_nested_objects?
- raise 'Nested groups are not supported on MySQL'
+ raise _('Nested groups are not supported on MySQL')
end
create_group_path
diff --git a/app/services/groups/transfer_service.rb b/app/services/groups/transfer_service.rb
index f64e327416a..f52abb3f40d 100644
--- a/app/services/groups/transfer_service.rb
+++ b/app/services/groups/transfer_service.rb
@@ -3,11 +3,11 @@
module Groups
class TransferService < Groups::BaseService
ERROR_MESSAGES = {
- database_not_supported: 'Database is not supported.',
- namespace_with_same_path: 'The parent group already has a subgroup with the same path.',
- group_is_already_root: 'Group is already a root group.',
- same_parent_as_current: 'Group is already associated to the parent group.',
- invalid_policies: "You don't have enough permissions."
+ database_not_supported: _('Database is not supported.'),
+ namespace_with_same_path: _('The parent group already has a subgroup with the same path.'),
+ group_is_already_root: _('Group is already a root group.'),
+ same_parent_as_current: _('Group is already associated to the parent group.'),
+ invalid_policies: _("You don't have enough permissions.")
}.freeze
TransferError = Class.new(StandardError)
diff --git a/app/services/import/github_service.rb b/app/services/import/github_service.rb
index a2533683da9..a322a306ba4 100644
--- a/app/services/import/github_service.rb
+++ b/app/services/import/github_service.rb
@@ -7,7 +7,7 @@ module Import
def execute(access_params, provider)
unless authorized?
- return error('This namespace has already been taken! Please choose another one.', :unprocessable_entity)
+ return error(_('This namespace has already been taken! Please choose another one.'), :unprocessable_entity)
end
project = Gitlab::LegacyGithubImport::ProjectCreator
diff --git a/app/services/issues/move_service.rb b/app/services/issues/move_service.rb
index 41b6a96b005..961e0aa6d0f 100644
--- a/app/services/issues/move_service.rb
+++ b/app/services/issues/move_service.rb
@@ -8,11 +8,11 @@ module Issues
@target_project = target_project
unless issue.can_move?(current_user, @target_project)
- raise MoveError, 'Cannot move issue due to insufficient permissions!'
+ raise MoveError, _('Cannot move issue due to insufficient permissions!')
end
if @project == @target_project
- raise MoveError, 'Cannot move issue to project it originates from!'
+ raise MoveError, _('Cannot move issue to project it originates from!')
end
super
diff --git a/app/services/lfs/lock_file_service.rb b/app/services/lfs/lock_file_service.rb
index c7730d24bdc..9e01b553348 100644
--- a/app/services/lfs/lock_file_service.rb
+++ b/app/services/lfs/lock_file_service.rb
@@ -4,7 +4,7 @@ module Lfs
class LockFileService < BaseService
def execute
unless can?(current_user, :push_code, project)
- raise Gitlab::GitAccess::UnauthorizedError, 'You have no permissions'
+ raise Gitlab::GitAccess::UnauthorizedError, _('You have no permissions')
end
create_lock!
diff --git a/app/services/members/create_service.rb b/app/services/members/create_service.rb
index 714b8586737..20e0f5f27f4 100644
--- a/app/services/members/create_service.rb
+++ b/app/services/members/create_service.rb
@@ -5,7 +5,7 @@ module Members
DEFAULT_LIMIT = 100
def execute(source)
- return error('No users specified.') if params[:user_ids].blank?
+ return error(_('No users specified.')) if params[:user_ids].blank?
user_ids = params[:user_ids].split(',').uniq
diff --git a/app/services/merge_requests/merge_service.rb b/app/services/merge_requests/merge_service.rb
index 70a67baa01c..fb3b2900cd5 100644
--- a/app/services/merge_requests/merge_service.rb
+++ b/app/services/merge_requests/merge_service.rb
@@ -76,7 +76,7 @@ module MergeRequests
if commit_id
log_info("Git merge finished on JID #{merge_jid} commit #{commit_id}")
else
- raise MergeError, 'Conflicts detected during merge'
+ raise MergeError, _('Conflicts detected during merge')
end
merge_request.update!(merge_commit_sha: commit_id)
@@ -88,10 +88,10 @@ module MergeRequests
repository.merge(current_user, source, merge_request, message)
rescue Gitlab::Git::PreReceiveError => e
handle_merge_error(log_message: e.message)
- raise MergeError, 'Something went wrong during merge pre-receive hook'
+ raise MergeError, _('Something went wrong during merge pre-receive hook')
rescue => e
handle_merge_error(log_message: e.message)
- raise MergeError, 'Something went wrong during merge'
+ raise MergeError, _('Something went wrong during merge')
ensure
merge_request.update!(in_progress_merge_commit_sha: nil)
end
diff --git a/app/services/merge_requests/squash_service.rb b/app/services/merge_requests/squash_service.rb
index a439a380255..d97326fbdfa 100644
--- a/app/services/merge_requests/squash_service.rb
+++ b/app/services/merge_requests/squash_service.rb
@@ -6,7 +6,7 @@ module MergeRequests
@merge_request = merge_request
@repository = target_project.repository
- squash || error('Failed to squash. Should be done manually.')
+ squash || error(_('Failed to squash. Should be done manually.'))
end
def squash
@@ -15,7 +15,7 @@ module MergeRequests
end
if merge_request.squash_in_progress?
- return error('Squash task canceled: another squash is already in progress.')
+ return error(_('Squash task canceled: another squash is already in progress.'))
end
squash_sha = repository.squash(current_user, merge_request)
diff --git a/app/services/milestones/promote_service.rb b/app/services/milestones/promote_service.rb
index cbe5996e8ca..b75276f1e6f 100644
--- a/app/services/milestones/promote_service.rb
+++ b/app/services/milestones/promote_service.rb
@@ -45,7 +45,7 @@ module Milestones
end
def check_project_milestone!(milestone)
- raise_error('Only project milestones can be promoted.') unless milestone.project_milestone?
+ raise_error(_('Only project milestones can be promoted.')) unless milestone.project_milestone?
end
def clone_project_milestone(milestone)
@@ -73,7 +73,7 @@ module Milestones
# rubocop: enable CodeReuse/ActiveRecord
def group
- @group ||= parent.group || raise_error('Project does not belong to a group.')
+ @group ||= parent.group || raise_error(_('Project does not belong to a group.'))
end
# rubocop: disable CodeReuse/ActiveRecord
diff --git a/app/services/notification_recipient_service.rb b/app/services/notification_recipient_service.rb
index 68cdc69023a..81734bd6e31 100644
--- a/app/services/notification_recipient_service.rb
+++ b/app/services/notification_recipient_service.rb
@@ -31,11 +31,11 @@ module NotificationRecipientService
module Builder
class Base
def initialize(*)
- raise 'abstract'
+ raise _('abstract')
end
def build!
- raise 'abstract'
+ raise _('abstract')
end
def filter!
@@ -47,7 +47,7 @@ module NotificationRecipientService
end
def target
- raise 'abstract'
+ raise _('abstract')
end
def project
diff --git a/app/services/projects/batch_count_service.rb b/app/services/projects/batch_count_service.rb
index aec3b32da89..93c5022a14d 100644
--- a/app/services/projects/batch_count_service.rb
+++ b/app/services/projects/batch_count_service.rb
@@ -23,11 +23,11 @@ module Projects
end
def global_count(project)
- raise NotImplementedError, 'global_count must be implemented and return an hash indexed by the project id'
+ raise NotImplementedError, _('global_count must be implemented and return an hash indexed by the project id')
end
def count_service
- raise NotImplementedError, 'count_service must be implemented and return a Projects::CountService object'
+ raise NotImplementedError, _('count_service must be implemented and return a Projects::CountService object')
end
end
end
diff --git a/app/services/projects/count_service.rb b/app/services/projects/count_service.rb
index 3cee80c7bbc..ab4dce988cc 100644
--- a/app/services/projects/count_service.rb
+++ b/app/services/projects/count_service.rb
@@ -20,7 +20,7 @@ module Projects
def cache_key_name
raise(
NotImplementedError,
- '"cache_key_name" must be implemented and return a String'
+ _('"cache_key_name" must be implemented and return a String')
)
end
@@ -33,7 +33,7 @@ module Projects
def self.query(project_ids)
raise(
NotImplementedError,
- '"query" must be implemented and return an ActiveRecord::Relation'
+ _('"query" must be implemented and return an ActiveRecord::Relation')
)
end
end
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb
index d03137b63b2..44638491222 100644
--- a/app/services/projects/create_service.rb
+++ b/app/services/projects/create_service.rb
@@ -142,7 +142,7 @@ module Projects
end
unless @project.import?
- raise 'Failed to create repository' unless @project.create_repository
+ raise _('Failed to create repository') unless @project.create_repository
end
end
end
diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb
index b14b31302f5..4a42d40e026 100644
--- a/app/services/projects/destroy_service.rb
+++ b/app/services/projects/destroy_service.rb
@@ -61,11 +61,11 @@ module Projects
flush_caches(@project)
unless rollback_repository(removal_path(repo_path), repo_path)
- raise_error('Failed to restore project repository. Please contact the administrator.')
+ raise_error(_('Failed to restore project repository. Please contact the administrator.'))
end
unless rollback_repository(removal_path(wiki_path), wiki_path)
- raise_error('Failed to restore wiki repository. Please contact the administrator.')
+ raise_error(_('Failed to restore wiki repository. Please contact the administrator.'))
end
end
@@ -81,11 +81,11 @@ module Projects
def trash_repositories!
unless remove_repository(repo_path)
- raise_error('Failed to remove project repository. Please try again or contact administrator.')
+ raise_error(_('Failed to remove project repository. Please try again or contact administrator.'))
end
unless remove_repository(wiki_path)
- raise_error('Failed to remove wiki repository. Please try again or contact administrator.')
+ raise_error(_('Failed to remove wiki repository. Please try again or contact administrator.'))
end
end
@@ -148,7 +148,7 @@ module Projects
def attempt_destroy_transaction(project)
unless remove_registry_tags
- raise_error('Failed to remove some tags in project container registry. Please try again or contact administrator.')
+ raise_error(_('Failed to remove some tags in project container registry. Please try again or contact administrator.'))
end
project.leave_pool_repository
diff --git a/app/services/projects/import_service.rb b/app/services/projects/import_service.rb
index 0c426faa22d..1dbed226308 100644
--- a/app/services/projects/import_service.rb
+++ b/app/services/projects/import_service.rb
@@ -53,7 +53,7 @@ module Projects
def create_repository
unless project.create_repository
- raise Error, 'The repository could not be created.'
+ raise Error, _('The repository could not be created.')
end
end
@@ -104,7 +104,7 @@ module Projects
project.repository.expire_content_cache unless project.gitlab_project_import?
unless importer.execute
- raise Error, 'The remote data could not be imported.'
+ raise Error, _('The remote data could not be imported.')
end
end
diff --git a/app/services/projects/lfs_pointers/lfs_import_service.rb b/app/services/projects/lfs_pointers/lfs_import_service.rb
index 9215fa0a7bf..04dd1192a91 100644
--- a/app/services/projects/lfs_pointers/lfs_import_service.rb
+++ b/app/services/projects/lfs_pointers/lfs_import_service.rb
@@ -68,13 +68,13 @@ module Projects
end
end
rescue URI::InvalidURIError
- raise LfsImportError, 'Invalid URL in .lfsconfig file'
+ raise LfsImportError, _('Invalid URL in .lfsconfig file')
end
def import_uri
@import_uri ||= URI.parse(project.import_url)
rescue URI::InvalidURIError
- raise LfsImportError, 'Invalid project import URL'
+ raise LfsImportError, _('Invalid project import URL')
end
def current_endpoint_uri
diff --git a/app/services/projects/transfer_service.rb b/app/services/projects/transfer_service.rb
index 5da1e39a1fb..da8ab081da8 100644
--- a/app/services/projects/transfer_service.rb
+++ b/app/services/projects/transfer_service.rb
@@ -17,11 +17,11 @@ module Projects
@new_namespace = new_namespace
if @new_namespace.blank?
- raise TransferError, 'Please select a new namespace for your project.'
+ raise TransferError, _('Please select a new namespace for your project.')
end
unless allowed_transfer?(current_user, project)
- raise TransferError, 'Transfer failed, please contact an admin.'
+ raise TransferError, _('Transfer failed, please contact an admin.')
end
transfer(project)
diff --git a/app/services/projects/update_pages_service.rb b/app/services/projects/update_pages_service.rb
index eb2478be3cf..368d7bf8c2c 100644
--- a/app/services/projects/update_pages_service.rb
+++ b/app/services/projects/update_pages_service.rb
@@ -23,8 +23,8 @@ module Projects
@status.enqueue!
@status.run!
- raise InvalidStateError, 'missing pages artifacts' unless build.artifacts?
- raise InvalidStateError, 'pages are outdated' unless latest?
+ raise InvalidStateError, _('missing pages artifacts') unless build.artifacts?
+ raise InvalidStateError, _('pages are outdated') unless latest?
# Create temporary directory in which we will extract the artifacts
FileUtils.mkdir_p(tmp_path)
@@ -33,8 +33,8 @@ module Projects
# Check if we did extract public directory
archive_public_path = File.join(archive_path, 'public')
- raise InvalidStateError, 'pages miss the public folder' unless Dir.exist?(archive_public_path)
- raise InvalidStateError, 'pages are outdated' unless latest?
+ raise InvalidStateError, _('pages miss the public folder') unless Dir.exist?(archive_public_path)
+ raise InvalidStateError, _('pages are outdated') unless latest?
deploy_page!(archive_public_path)
success
@@ -77,12 +77,12 @@ module Projects
if artifacts.ends_with?('.zip')
extract_zip_archive!(temp_path)
else
- raise InvalidStateError, 'unsupported artifacts format'
+ raise InvalidStateError, _('unsupported artifacts format')
end
end
def extract_zip_archive!(temp_path)
- raise InvalidStateError, 'missing artifacts metadata' unless build.artifacts_metadata?
+ raise InvalidStateError, _('missing artifacts metadata') unless build.artifacts_metadata?
# Calculate page size after extract
public_entry = build.artifacts_metadata_entry(SITE_PATH, recursive: true)
@@ -98,7 +98,7 @@ module Projects
site_path = File.join(SITE_PATH, '*')
build.artifacts_file.use_file do |artifacts_path|
unless system(*%W(unzip -n #{artifacts_path} #{site_path} -d #{temp_path}))
- raise FailedToExtractError, 'pages failed to extract'
+ raise FailedToExtractError, _('pages failed to extract')
end
end
end
diff --git a/app/services/projects/update_service.rb b/app/services/projects/update_service.rb
index 6856009b395..1ea890a7add 100644
--- a/app/services/projects/update_service.rb
+++ b/app/services/projects/update_service.rb
@@ -39,11 +39,11 @@ module Projects
def validate!
unless valid_visibility_level_change?(project, params[:visibility_level])
- raise ValidationError.new('New visibility level not allowed!')
+ raise ValidationError.new(_('New visibility level not allowed!'))
end
if renaming_project_with_container_registry_tags?
- raise ValidationError.new('Cannot rename project because it contains container registry tags!')
+ raise ValidationError.new(_('Cannot rename project because it contains container registry tags!'))
end
if changing_default_branch?
@@ -88,7 +88,7 @@ module Projects
def update_failed!
model_errors = project.errors.full_messages.to_sentence
- error_message = model_errors.presence || 'Project could not be updated!'
+ error_message = model_errors.presence || _('Project could not be updated!')
error(error_message)
end
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb
index 5c58caee8cd..1a87962c174 100644
--- a/app/services/quick_actions/interpret_service.rb
+++ b/app/services/quick_actions/interpret_service.rb
@@ -87,7 +87,7 @@ module QuickActions
end
desc 'Merge (when the pipeline succeeds)'
- explanation 'Merges this merge request when the pipeline succeeds.'
+ explanation _('Merges this merge request when the pipeline succeeds.')
condition do
last_diff_sha = params && params[:merge_request_diff_head_sha]
issuable.is_a?(MergeRequest) &&
@@ -232,7 +232,7 @@ module QuickActions
labels = find_label_references(labels_param)
"Removes #{labels.join(' ')} #{'label'.pluralize(labels.count)}." if labels.any?
else
- 'Removes all labels.'
+ _('Removes all labels.')
end
end
params '~label1 ~"label 2"'
@@ -301,7 +301,7 @@ module QuickActions
end
desc 'Add a todo'
- explanation 'Adds a todo.'
+ explanation _('Adds a todo.')
condition do
issuable.is_a?(Issuable) &&
issuable.persisted? &&
@@ -312,7 +312,7 @@ module QuickActions
end
desc 'Mark todo as done'
- explanation 'Marks todo as done.'
+ explanation _('Marks todo as done.')
condition do
issuable.persisted? &&
TodoService.new.todo_exist?(issuable, current_user)
@@ -364,7 +364,7 @@ module QuickActions
end
desc 'Remove due date'
- explanation 'Removes the due date.'
+ explanation _('Removes the due date.')
condition do
issuable.persisted? &&
issuable.respond_to?(:due_date) &&
@@ -461,7 +461,7 @@ module QuickActions
end
desc 'Remove time estimate'
- explanation 'Removes time estimate.'
+ explanation _('Removes time estimate.')
condition do
issuable.persisted? &&
current_user.can?(:"admin_#{issuable.to_ability_name}", project)
@@ -471,7 +471,7 @@ module QuickActions
end
desc 'Remove spent time'
- explanation 'Removes spent time.'
+ explanation _('Removes spent time.')
condition do
issuable.persisted? &&
current_user.can?(:"admin_#{issuable.to_ability_name}", project)
@@ -584,7 +584,7 @@ module QuickActions
end
end
- desc 'Move this issue to another project.'
+ desc _('Move this issue to another project.')
explanation do |path_to_project|
"Moves this issue to #{path_to_project}."
end
@@ -602,7 +602,7 @@ module QuickActions
end
end
- desc 'Make issue confidential.'
+ desc _('Make issue confidential.')
explanation do
'Makes this issue confidential'
end
@@ -613,7 +613,7 @@ module QuickActions
@updates[:confidential] = true
end
- desc 'Tag this commit.'
+ desc _('Tag this commit.')
explanation do |tag_name, message|
with_message = %{ with "#{message}"} if message.present?
"Tags this commit to #{tag_name}#{with_message}."
@@ -630,7 +630,7 @@ module QuickActions
@updates[:tag_message] = message
end
- desc 'Create a merge request.'
+ desc _('Create a merge request.')
explanation do |branch_name = nil|
branch_text = branch_name ? "branch '#{branch_name}'" : 'a branch'
"Creates #{branch_text} and a merge request to resolve this issue"
diff --git a/app/services/submodules/update_service.rb b/app/services/submodules/update_service.rb
index a6011a920bd..a4f24f7a121 100644
--- a/app/services/submodules/update_service.rb
+++ b/app/services/submodules/update_service.rb
@@ -16,7 +16,7 @@ module Submodules
def validate!
super
- raise ValidationError, 'The repository is empty' if repository.empty?
+ raise ValidationError, _('The repository is empty') if repository.empty?
end
def execute
@@ -32,7 +32,7 @@ module Submodules
message: @commit_message,
branch: @branch_name)
rescue ArgumentError, TypeError
- raise ValidationError, 'Invalid parameters'
+ raise ValidationError, _('Invalid parameters')
end
end
end
diff --git a/app/services/test_hooks/project_service.rb b/app/services/test_hooks/project_service.rb
index 7e14ddcd017..90a95a95b9c 100644
--- a/app/services/test_hooks/project_service.rb
+++ b/app/services/test_hooks/project_service.rb
@@ -11,7 +11,7 @@ module TestHooks
private
def push_events_data
- throw(:validation_error, 'Ensure the project has at least one commit.') if project.empty_repo?
+ throw(:validation_error, _('Ensure the project has at least one commit.')) if project.empty_repo?
Gitlab::DataBuilder::Push.build_sample(project, current_user)
end
@@ -20,14 +20,14 @@ module TestHooks
def note_events_data
note = project.notes.first
- throw(:validation_error, 'Ensure the project has notes.') unless note.present?
+ throw(:validation_error, _('Ensure the project has notes.')) unless note.present?
Gitlab::DataBuilder::Note.build(note, current_user)
end
def issues_events_data
issue = project.issues.first
- throw(:validation_error, 'Ensure the project has issues.') unless issue.present?
+ throw(:validation_error, _('Ensure the project has issues.')) unless issue.present?
issue.to_hook_data(current_user)
end
@@ -36,21 +36,21 @@ module TestHooks
def merge_requests_events_data
merge_request = project.merge_requests.first
- throw(:validation_error, 'Ensure the project has merge requests.') unless merge_request.present?
+ throw(:validation_error, _('Ensure the project has merge requests.')) unless merge_request.present?
merge_request.to_hook_data(current_user)
end
def job_events_data
build = project.builds.first
- throw(:validation_error, 'Ensure the project has CI jobs.') unless build.present?
+ throw(:validation_error, _('Ensure the project has CI jobs.')) unless build.present?
Gitlab::DataBuilder::Build.build(build)
end
def pipeline_events_data
pipeline = project.ci_pipelines.first
- throw(:validation_error, 'Ensure the project has CI pipelines.') unless pipeline.present?
+ throw(:validation_error, _('Ensure the project has CI pipelines.')) unless pipeline.present?
Gitlab::DataBuilder::Pipeline.build(pipeline)
end
@@ -58,7 +58,7 @@ module TestHooks
def wiki_page_events_data
page = project.wiki.pages.first
if !project.wiki_enabled? || page.blank?
- throw(:validation_error, 'Ensure the wiki is enabled and has pages.')
+ throw(:validation_error, _('Ensure the wiki is enabled and has pages.'))
end
Gitlab::DataBuilder::WikiPage.build(page, current_user, 'create')
diff --git a/app/services/test_hooks/system_service.rb b/app/services/test_hooks/system_service.rb
index 082830c5538..79f60934037 100644
--- a/app/services/test_hooks/system_service.rb
+++ b/app/services/test_hooks/system_service.rb
@@ -18,7 +18,7 @@ module TestHooks
def merge_requests_events_data
merge_request = MergeRequest.of_projects(current_user.projects.select(:id)).first
- throw(:validation_error, 'Ensure one of your projects has merge requests.') unless merge_request.present?
+ throw(:validation_error, _('Ensure one of your projects has merge requests.')) unless merge_request.present?
merge_request.to_hook_data(current_user)
end