diff options
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/application_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/blob_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/projects/forks_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/hooks_controller.rb | 7 | ||||
-rw-r--r-- | app/controllers/projects/labels_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/services_controller.rb | 7 | ||||
-rw-r--r-- | app/controllers/projects/wikis_controller.rb | 11 |
7 files changed, 20 insertions, 16 deletions
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb index 657ee94cfd7..2cdf098cee6 100644 --- a/app/controllers/projects/application_controller.rb +++ b/app/controllers/projects/application_controller.rb @@ -75,7 +75,7 @@ class Projects::ApplicationController < ApplicationController unless @repository.branch_names.include?(@ref) redirect_to( namespace_project_tree_path(@project.namespace, @project, @ref), - notice: "This action is not allowed unless you are on a branch" + notice: "除在分支的顶层外不允许本操作" ) end end diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index cd8b2911674..75320453ced 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -1,3 +1,4 @@ +#encoding: utf-8 # Controller for viewing a file's blame class Projects::BlobController < Projects::ApplicationController include ExtractsPath @@ -22,7 +23,7 @@ class Projects::BlobController < Projects::ApplicationController end def create - create_commit(Files::CreateService, success_notice: "The file has been successfully created.", + create_commit(Files::CreateService, success_notice: "文件已创建成功。", success_path: namespace_project_blob_path(@project.namespace, @project, File.join(@target_branch, @file_path)), failure_view: :new, failure_path: namespace_project_new_blob_path(@project.namespace, @project, @ref)) @@ -62,7 +63,7 @@ class Projects::BlobController < Projects::ApplicationController end def destroy - create_commit(Files::DeleteService, success_notice: "The file has been successfully deleted.", + create_commit(Files::DeleteService, success_notice: "文件已删除成功。", success_path: namespace_project_tree_path(@project.namespace, @project, @target_branch), failure_view: :show, failure_path: namespace_project_blob_path(@project.namespace, @project, @id)) diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb index a1b8632df98..faab7f19c18 100644 --- a/app/controllers/projects/forks_controller.rb +++ b/app/controllers/projects/forks_controller.rb @@ -48,7 +48,7 @@ class Projects::ForksController < Projects::ApplicationController if continue_params redirect_to continue_params[:to], notice: continue_params[:notice] else - redirect_to namespace_project_path(@forked_project.namespace, @forked_project), notice: "The project '#{@forked_project.name}' was successfully forked." + redirect_to namespace_project_path(@forked_project.namespace, @forked_project), notice: "项目 '#{@forked_project.name}' 项目成功。" end end else diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb index 5fd4f855dec..d781e7679a6 100644 --- a/app/controllers/projects/hooks_controller.rb +++ b/app/controllers/projects/hooks_controller.rb @@ -1,3 +1,4 @@ +#encoding: utf-8 class Projects::HooksController < Projects::ApplicationController # Authorize before_action :authorize_admin_project! @@ -28,12 +29,12 @@ class Projects::HooksController < Projects::ApplicationController status, message = TestHookService.new.execute(hook, current_user) if status - flash[:notice] = 'Hook successfully executed.' + flash[:notice] = '钩子执行成功。' else - flash[:alert] = "Hook execution failed: #{message}" + flash[:alert] = "钩子执行失败:#{message}" end else - flash[:alert] = 'Hook execution failed. Ensure the project has commits.' + flash[:alert] = '钩子执行失败。确保项目已提交。' end redirect_back_or_default(default: { action: 'index' }) diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb index 5f471d405f5..66f07d7bd09 100644 --- a/app/controllers/projects/labels_controller.rb +++ b/app/controllers/projects/labels_controller.rb @@ -65,7 +65,7 @@ class Projects::LabelsController < Projects::ApplicationController respond_to do |format| format.html do redirect_to(namespace_project_labels_path(@project.namespace, @project), - notice: 'Label was removed') + notice: '标记已删除') end format.js end diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb index 8b2577aebe1..42416acd902 100644 --- a/app/controllers/projects/services_controller.rb +++ b/app/controllers/projects/services_controller.rb @@ -1,3 +1,4 @@ +#encoding: utf-8 class Projects::ServicesController < Projects::ApplicationController ALLOWED_PARAMS = [:title, :token, :type, :active, :api_key, :api_url, :api_version, :subdomain, :room, :recipients, :project_url, :webhook, @@ -37,7 +38,7 @@ class Projects::ServicesController < Projects::ApplicationController redirect_to( edit_namespace_project_service_path(@project.namespace, @project, @service.to_param, notice: - 'Successfully updated.') + '已更新成功。') ) else render 'edit' @@ -48,9 +49,9 @@ class Projects::ServicesController < Projects::ApplicationController data = Gitlab::PushDataBuilder.build_sample(project, current_user) outcome = @service.test(data) if outcome[:success] - message = { notice: 'We sent a request to the provided URL' } + message = { notice: '已发送请求到提供的链接' } else - error_message = "We tried to send a request to the provided URL but an error occurred" + error_message = "已发送请求到提供的链接,但收到一个错误回应" error_message << ": #{outcome[:result]}" if outcome[:result].present? message = { alert: error_message } end diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb index 88fccfed509..ed19ec2aa9f 100644 --- a/app/controllers/projects/wikis_controller.rb +++ b/app/controllers/projects/wikis_controller.rb @@ -1,3 +1,4 @@ +#encoding: utf-8 require 'project_wiki' class Projects::WikisController < Projects::ApplicationController @@ -47,7 +48,7 @@ class Projects::WikisController < Projects::ApplicationController if @page.update(content, format, message) redirect_to( namespace_project_wiki_path(@project.namespace, @project, @page), - notice: 'Wiki was successfully updated.' + notice: '维基更新成功。' ) else render 'edit' @@ -60,7 +61,7 @@ class Projects::WikisController < Projects::ApplicationController if @page.create(wiki_params) redirect_to( namespace_project_wiki_path(@project.namespace, @project, @page), - notice: 'Wiki was successfully updated.' + notice: '维基更新成功。' ) else render action: "edit" @@ -73,7 +74,7 @@ class Projects::WikisController < Projects::ApplicationController unless @page redirect_to( namespace_project_wiki_path(@project.namespace, @project, :home), - notice: "Page not found" + notice: "页面不存在" ) end end @@ -84,7 +85,7 @@ class Projects::WikisController < Projects::ApplicationController redirect_to( namespace_project_wiki_path(@project.namespace, @project, :home), - notice: "Page was successfully deleted" + notice: "维基删除成功" ) end @@ -99,7 +100,7 @@ class Projects::WikisController < Projects::ApplicationController # Call #wiki to make sure the Wiki Repo is initialized @project_wiki.wiki rescue ProjectWiki::CouldNotCreateWikiError - flash[:notice] = "Could not create Wiki Repository at this time. Please try again later." + flash[:notice] = "现在不能创建维基版本仓库。请稍后重试。" redirect_to project_path(@project) return false end |