diff options
Diffstat (limited to 'app/services/projects')
-rw-r--r-- | app/services/projects/destroy_service.rb | 10 | ||||
-rw-r--r-- | app/services/projects/import_service.rb | 10 | ||||
-rw-r--r-- | app/services/projects/transfer_service.rb | 10 | ||||
-rw-r--r-- | app/services/projects/update_service.rb | 8 |
4 files changed, 19 insertions, 19 deletions
diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb index b14b31302f5..d8e670e40ce 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(s_('DeleteProject|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(s_('DeleteProject|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(s_('DeleteProject|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(s_('DeleteProject|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(s_('DeleteProject|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 7214e9efaf6..642465551c9 100644 --- a/app/services/projects/import_service.rb +++ b/app/services/projects/import_service.rb @@ -27,13 +27,13 @@ module Projects rescue Gitlab::UrlBlocker::BlockedUrlError => e Gitlab::Sentry.track_acceptable_exception(e, extra: { project_path: project.full_path, importer: project.import_type }) - error("Error importing repository #{project.safe_import_url} into #{project.full_path} - #{e.message}") + error(s_("ImportProjects|Error importing repository %{project_safe_import_url} into %{project_full_path} - %{message}") % { project_safe_import_url: project.safe_import_url, project_full_path: project.full_path, message: e.message }) rescue => e message = Projects::ImportErrorFilter.filter_message(e.message) Gitlab::Sentry.track_acceptable_exception(e, extra: { project_path: project.full_path, importer: project.import_type }) - error("Error importing repository #{project.safe_import_url} into #{project.full_path} - #{message}") + error(s_("ImportProjects|Error importing repository %{project_safe_import_url} into %{project_full_path} - %{message}") % { project_safe_import_url: project.safe_import_url, project_full_path: project.full_path, message: message }) end private @@ -43,7 +43,7 @@ module Projects begin Gitlab::UrlBlocker.validate!(project.import_url, ports: Project::VALID_IMPORT_PORTS) rescue Gitlab::UrlBlocker::BlockedUrlError => e - raise e, "Blocked import URL: #{e.message}" + raise e, s_("ImportProjects|Blocked import URL: %{message}") % { message: e.message } end end @@ -61,7 +61,7 @@ module Projects def create_repository unless project.create_repository - raise Error, 'The repository could not be created.' + raise Error, s_('ImportProjects|The repository could not be created.') end end @@ -112,7 +112,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, s_('ImportProjects|The remote data could not be imported.') end end diff --git a/app/services/projects/transfer_service.rb b/app/services/projects/transfer_service.rb index 5da1e39a1fb..9458bd6e1f7 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, s_('TransferProject|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, s_('TransferProject|Transfer failed, please contact an admin.') end transfer(project) @@ -45,12 +45,12 @@ module Projects @old_namespace = project.namespace if Project.where(namespace_id: @new_namespace.try(:id)).where('path = ? or name = ?', project.path, project.name).exists? - raise TransferError.new("Project with same name or path in target namespace already exists") + raise TransferError.new(s_("TransferProject|Project with same name or path in target namespace already exists")) end if project.has_container_registry_tags? # We currently don't support renaming repository if it contains tags in container registry - raise TransferError.new('Project cannot be transferred, because tags are present in its container registry') + raise TransferError.new(s_('TransferProject|Project cannot be transferred, because tags are present in its container registry')) end attempt_transfer_transaction @@ -145,7 +145,7 @@ module Projects # Move main repository unless move_repo_folder(@old_path, @new_path) - raise TransferError.new("Cannot move project") + raise TransferError.new(s_("TransferProject|Cannot move project")) end # Disk path is changed; we need to ensure we reload it diff --git a/app/services/projects/update_service.rb b/app/services/projects/update_service.rb index bc36bb8659d..864ce4fa9f5 100644 --- a/app/services/projects/update_service.rb +++ b/app/services/projects/update_service.rb @@ -42,15 +42,15 @@ module Projects def validate! unless valid_visibility_level_change?(project, params[:visibility_level]) - raise ValidationError.new('New visibility level not allowed!') + raise ValidationError.new(s_('UpdateProject|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(s_('UpdateProject|Cannot rename project because it contains container registry tags!')) end if changing_default_branch? - raise ValidationError.new("Could not set the default branch") unless project.change_head(params[:default_branch]) + raise ValidationError.new(s_("UpdateProject|Could not set the default branch")) unless project.change_head(params[:default_branch]) end end @@ -91,7 +91,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 || s_('UpdateProject|Project could not be updated!') error(error_message) end |