diff options
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 4 | ||||
-rw-r--r-- | app/helpers/ci_status_helper.rb | 19 | ||||
-rw-r--r-- | app/helpers/issues_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/search_helper.rb | 26 | ||||
-rw-r--r-- | app/helpers/visibility_level_helper.rb | 6 |
5 files changed, 37 insertions, 20 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e32f94929e5..c8af42cbb1f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -201,11 +201,11 @@ module ApplicationHelper return if object.updated_at == object.created_at content_tag :small, class: "edited-text" do - output = content_tag(:span, "Edited ") + output = content_tag(:span, "编辑时间 ") output << time_ago_with_tooltip(object.updated_at, placement: placement, html_class: html_class) if include_author && object.updated_by && object.updated_by != object.author - output << content_tag(:span, " by ") + output << content_tag(:span, " 由 ") output << link_to_member(object.project, object.updated_by, avatar: false, author_class: nil) end diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index 724146443b8..b423f4f11e0 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -46,11 +46,28 @@ module CiStatusHelper icon(icon_name + ' fw') end + def ci_status_zh(status) + case status + when 'pending' + '排队' + when 'running' + '运行' + when 'success' + '成功' + when 'failed' + '失败' + when 'canceled' + '取消' + else + '未知' + end + end + def render_ci_status(ci_commit, tooltip_placement: 'auto left') link_to ci_status_icon(ci_commit), ci_status_path(ci_commit), class: "ci-status-link ci-status-icon-#{ci_commit.status.dasherize}", - title: "Build #{ci_status_label(ci_commit)}", + title: "构建状态:#{ci_status_label(ci_commit)}", data: { toggle: 'tooltip', placement: tooltip_placement } end diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index cd630bb6973..4a52db4e8fb 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -64,7 +64,7 @@ module IssuesHelper current_user.can?(ability, project) end - no_project = OpenStruct.new(id: 0, name_with_namespace: 'No project') + no_project = OpenStruct.new(id: 0, name_with_namespace: '没有项目') projects.unshift(no_project) projects.delete(issuable.project) diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index bb61fc1d5c1..f28ac1e3278 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -24,25 +24,25 @@ module SearchHelper # Autocomplete results for various settings pages def default_autocomplete [ - { label: "Profile settings", url: profile_path }, - { label: "SSH Keys", url: profile_keys_path }, - { label: "Dashboard", url: root_path }, - { label: "Admin Section", url: admin_root_path }, + { label: "个人资料设置", url: profile_path }, + { label: "SSH 密钥", url: profile_keys_path }, + { label: "仪表盘", url: root_path }, + { label: "管理后台", url: admin_root_path }, ] end # Autocomplete results for internal help pages def help_autocomplete [ - { label: "help: API Help", url: help_page_path("api", "README") }, - { label: "help: Markdown Help", url: help_page_path("markdown", "markdown") }, - { label: "help: Permissions Help", url: help_page_path("permissions", "permissions") }, - { label: "help: Public Access Help", url: help_page_path("public_access", "public_access") }, - { label: "help: Rake Tasks Help", url: help_page_path("raketasks", "README") }, - { label: "help: SSH Keys Help", url: help_page_path("ssh", "README") }, - { label: "help: System Hooks Help", url: help_page_path("system_hooks", "system_hooks") }, - { label: "help: Webhooks Help", url: help_page_path("web_hooks", "web_hooks") }, - { label: "help: Workflow Help", url: help_page_path("workflow", "README") }, + { label: "帮助: API 帮助", url: help_page_path("api", "README") }, + { label: "帮助: Markdown 帮助", url: help_page_path("markdown", "markdown") }, + { label: "帮助: 权限帮助", url: help_page_path("permissions", "permissions") }, + { label: "帮助: 公开访问帮助", url: help_page_path("public_access", "public_access") }, + { label: "帮助: Rake 任务帮助", url: help_page_path("raketasks", "README") }, + { label: "帮助: SSH 密钥帮助", url: help_page_path("ssh", "README") }, + { label: "帮助: 系统钩子帮助", url: help_page_path("system_hooks", "system_hooks") }, + { label: "帮助: Web 钩子帮助", url: help_page_path("web_hooks", "web_hooks") }, + { label: "帮助: 工作流帮助", url: help_page_path("workflow", "README") }, ] end diff --git a/app/helpers/visibility_level_helper.rb b/app/helpers/visibility_level_helper.rb index 0bb3c1e1c0f..369210588c9 100644 --- a/app/helpers/visibility_level_helper.rb +++ b/app/helpers/visibility_level_helper.rb @@ -41,11 +41,11 @@ module VisibilityLevelHelper def group_visibility_level_description(level) case level when Gitlab::VisibilityLevel::PRIVATE - "The group and its projects can only be viewed by members." + "该群组和其项目只有其成员能以看到。" when Gitlab::VisibilityLevel::INTERNAL - "The group and any internal projects can be viewed by any logged in user." + "该群组和其内部项目只有已登录用户能看到。" when Gitlab::VisibilityLevel::PUBLIC - "The group and any public projects can be viewed without any authentication." + "该群组和其公开项目可以被任何授权的用户看到。" end end |