From e947030d9d632318ca0f86cd37ec900bedf95fe1 Mon Sep 17 00:00:00 2001 From: Tao Wang Date: Thu, 14 Jun 2018 19:06:13 +1000 Subject: [PATCH] i18n: externalize strings from 'app/views/projects/pipelines' Signed-off-by: Tao Wang --- .../projects/pipelines/_with_tabs.html.haml | 21 ++++++++------- app/views/projects/pipelines/charts.html.haml | 2 +- .../projects/pipelines/charts/_overall.haml | 8 +++--- app/views/projects/pipelines/index.html.haml | 2 +- app/views/projects/pipelines/new.html.haml | 6 ++--- app/views/projects/pipelines/show.html.haml | 4 +-- locale/gitlab.pot | 26 ++++++++++++++++--- 7 files changed, 44 insertions(+), 25 deletions(-) diff --git a/app/views/projects/pipelines/_with_tabs.html.haml b/app/views/projects/pipelines/_with_tabs.html.haml index c63ff070f709da..842494914f43e5 100644 --- a/app/views/projects/pipelines/_with_tabs.html.haml +++ b/app/views/projects/pipelines/_with_tabs.html.haml @@ -21,25 +21,26 @@ #js-tab-builds.tab-pane - if pipeline.yaml_errors.present? .bs-callout.bs-callout-danger - %h4 Found errors in your .gitlab-ci.yml: + %h4= _("Found errors in your .gitlab-ci.yml:") %ul - pipeline.yaml_errors.split(",").each do |error| %li= error - You can also test your .gitlab-ci.yml in the #{link_to "Lint", project_ci_lint_path(@project)} + - link_to_lint = link_to(_("Lint"), project_ci_lint_path(@project)) + = _("You can also test your .gitlab-ci.yml in the %{link_to_lint}").html_safe % { link_to_lint: link_to_lint } - if pipeline.project.builds_enabled? && !pipeline.ci_yaml_file .bs-callout.bs-callout-warning - \.gitlab-ci.yml not found in this commit + = _(".gitlab-ci.yml not found in this commit") .table-holder.pipeline-holder %table.table.ci-table.pipeline %thead %tr - %th Status - %th Job ID - %th Name + %th= _('Status') + %th= _('Job ID') + %th= _('Name') %th - %th Coverage + %th= _('Coverage') %th = render partial: "projects/stage/stage", collection: pipeline.legacy_stages, as: :stage @@ -61,11 +62,11 @@ = custom_icon("icon_status_#{build.status}") .d-md-none.build-badge = render "ci/status/badge", link: false, status: job.detailed_status(current_user) - %td.responsive-table-cell.build-name{ data: { column: _("Name")} } + %td.responsive-table-cell.build-name{ data: { column: _("Name") } } = link_to build.name, pipeline_job_url(pipeline, build) - %td.responsive-table-cell.build-stage{ data: { column: _("Stage")} } + %td.responsive-table-cell.build-stage{ data: { column: _("Stage") } } = build.stage.titleize - %td.responsive-table-cell.build-failure{ data: { column: _("Failure")} } + %td.responsive-table-cell.build-failure{ data: { column: _("Failure") } } = build.present.callout_failure_message %td.responsive-table-cell.build-actions = link_to retry_project_job_path(build.project, build, return_to: request.original_url), method: :post, title: _('Retry'), class: 'btn btn-build' do diff --git a/app/views/projects/pipelines/charts.html.haml b/app/views/projects/pipelines/charts.html.haml index a86cb14960aa35..8fd3ebf2f51dc5 100644 --- a/app/views/projects/pipelines/charts.html.haml +++ b/app/views/projects/pipelines/charts.html.haml @@ -1,5 +1,5 @@ - @no_container = true -- breadcrumb_title "CI / CD Charts" +- breadcrumb_title _("CI / CD Charts") - page_title _("Charts"), _("Pipelines") %div{ class: container_class } diff --git a/app/views/projects/pipelines/charts/_overall.haml b/app/views/projects/pipelines/charts/_overall.haml index 66786c7ff59667..7f2c6e95f64562 100644 --- a/app/views/projects/pipelines/charts/_overall.haml +++ b/app/views/projects/pipelines/charts/_overall.haml @@ -1,15 +1,15 @@ %h4= s_("PipelineCharts|Overall statistics") %ul %li - = s_("PipelineCharts|Total:") + #{s_("PipelineCharts|Total")}: %strong= n_("1 pipeline", "%d pipelines", @counts[:total]) % @counts[:total] %li - = s_("PipelineCharts|Successful:") + #{s_("PipelineCharts|Successful")}: %strong= n_("1 pipeline", "%d pipelines", @counts[:success]) % @counts[:success] %li - = s_("PipelineCharts|Failed:") + #{s_("PipelineCharts|Failed")}: %strong= n_("1 pipeline", "%d pipelines", @counts[:failed]) % @counts[:failed] %li - = s_("PipelineCharts|Success ratio:") + #{s_("PipelineCharts|Success ratio")}: %strong #{success_ratio(@counts)}% diff --git a/app/views/projects/pipelines/index.html.haml b/app/views/projects/pipelines/index.html.haml index cfb7a88f3d9d77..8f283412d8fd5f 100644 --- a/app/views/projects/pipelines/index.html.haml +++ b/app/views/projects/pipelines/index.html.haml @@ -1,5 +1,5 @@ - @no_container = true -- page_title "Pipelines" +- page_title _("Pipelines") = content_for :flash_message do = render 'shared/shared_runners_minutes_limit', project: @project diff --git a/app/views/projects/pipelines/new.html.haml b/app/views/projects/pipelines/new.html.haml index c13e3194340711..2c42dd4e25d0b0 100644 --- a/app/views/projects/pipelines/new.html.haml +++ b/app/views/projects/pipelines/new.html.haml @@ -1,4 +1,4 @@ -- breadcrumb_title "Pipelines" +- breadcrumb_title _("Pipelines") - page_title = s_("Pipeline|Run Pipeline") - settings_link = link_to _('CI/CD settings'), project_settings_ci_cd_path(@project) @@ -25,11 +25,11 @@ %ul.ci-variable-list = render 'ci/variables/variable_row', form_field: 'pipeline', only_key_value: true .form-text.text-muted - = (s_("Pipeline|Specify variable values to be used in this run. The values specified in %{settings_link} will be used by default.") % {settings_link: settings_link}).html_safe + = (s_("Pipeline|Specify variable values to be used in this run. The values specified in %{settings_link} will be used by default.") % { settings_link: settings_link }).html_safe .form-actions = f.submit s_('Pipeline|Create pipeline'), class: 'btn btn-success js-variables-save-button', tabindex: 3 - = link_to 'Cancel', project_pipelines_path(@project), class: 'btn btn-default float-right' + = link_to _('Cancel'), project_pipelines_path(@project), class: 'btn btn-default float-right' -# haml-lint:disable InlineJavaScript %script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe diff --git a/app/views/projects/pipelines/show.html.haml b/app/views/projects/pipelines/show.html.haml index ff0ed3ed30d98c..24506dad7a47b0 100644 --- a/app/views/projects/pipelines/show.html.haml +++ b/app/views/projects/pipelines/show.html.haml @@ -1,7 +1,7 @@ - @no_container = true -- add_to_breadcrumbs "Pipelines", project_pipelines_path(@project) +- add_to_breadcrumbs _("Pipelines"), project_pipelines_path(@project) - breadcrumb_title "##{@pipeline.id}" -- page_title "Pipeline" +- page_title _("Pipeline") .js-pipeline-container{ class: container_class, data: { controller_action: "#{controller.action_name}" } } #js-pipeline-header-vue.pipeline-header-container diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 0ea8789d6cbfc5..1ad40340a062f0 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -200,6 +200,9 @@ msgstr "" msgid "- show less" msgstr "" +msgid ".gitlab-ci.yml not found in this commit" +msgstr "" + msgid "1 %{type} addition" msgid_plural "%{count} %{type} additions" msgstr[0] "" @@ -1229,6 +1232,9 @@ msgstr "" msgid "CI / CD" msgstr "" +msgid "CI / CD Charts" +msgstr "" + msgid "CI / CD Settings" msgstr "" @@ -2223,6 +2229,9 @@ msgstr "" msgid "Copy token to clipboard" msgstr "" +msgid "Coverage" +msgstr "" + msgid "Create" msgstr "" @@ -4004,6 +4013,9 @@ msgstr "" msgid "Job" msgstr "" +msgid "Job ID" +msgstr "" + msgid "Job has been erased" msgstr "" @@ -4221,6 +4233,9 @@ msgstr[1] "" msgid "LinkedIn" msgstr "" +msgid "Lint" +msgstr "" + msgid "List" msgstr "" @@ -5104,19 +5119,19 @@ msgstr "" msgid "Pipeline triggers" msgstr "" -msgid "PipelineCharts|Failed:" +msgid "PipelineCharts|Failed" msgstr "" msgid "PipelineCharts|Overall statistics" msgstr "" -msgid "PipelineCharts|Success ratio:" +msgid "PipelineCharts|Success ratio" msgstr "" -msgid "PipelineCharts|Successful:" +msgid "PipelineCharts|Successful" msgstr "" -msgid "PipelineCharts|Total:" +msgid "PipelineCharts|Total" msgstr "" msgid "PipelineSchedules|Activated" @@ -7737,6 +7752,9 @@ msgstr "" msgid "You can also test your .gitlab-ci.yml in the %{linkStart}Lint%{linkEnd}" msgstr "" +msgid "You can also test your .gitlab-ci.yml in the %{link_to_lint}" +msgstr "" + msgid "You can easily contribute to them by requesting to join these groups." msgstr "" -- GitLab