diff --git a/app/assets/javascripts/ci/pipeline_details/header/pipeline_details_header.vue b/app/assets/javascripts/ci/pipeline_details/header/pipeline_details_header.vue index 1ecc4b2e1c14a274f4596e58b57a3b7d58acbbc9..6d305567937df79e80996d14cf00dbe608f0e382 100644 --- a/app/assets/javascripts/ci/pipeline_details/header/pipeline_details_header.vue +++ b/app/assets/javascripts/ci/pipeline_details/header/pipeline_details_header.vue @@ -14,7 +14,7 @@ import { import { BUTTON_TOOLTIP_RETRY, BUTTON_TOOLTIP_CANCEL } from '~/ci/constants'; import { timeIntervalInWords } from '~/lib/utils/datetime_utility'; import { setUrlFragment, redirectTo } from '~/lib/utils/url_utility'; // eslint-disable-line import/no-deprecated -import { __, s__, sprintf, formatNumber } from '~/locale'; +import { __, n__, s__, sprintf, formatNumber } from '~/locale'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import CiIcon from '~/vue_shared/components/ci_icon/ci_icon.vue'; @@ -249,8 +249,10 @@ export default { return this.pipeline?.commit?.title || ''; }, totalJobsText() { - return sprintf(__('%{jobs} Jobs'), { - jobs: this.pipeline?.totalJobs || 0, + const totalJobs = this.pipeline?.totalJobs || 0; + + return sprintf(n__('%{jobs} job', '%{jobs} jobs', totalJobs), { + jobs: totalJobs, }); }, triggeredText() { diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 9140de1a97bc92dc0059b277b1fd4be861c07ffa..6f5d113c385b0f546ab6393cf8780b5c36a7433a 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -812,8 +812,10 @@ msgstr "" msgid "%{jobName} job is being retried" msgstr "" -msgid "%{jobs} Jobs" -msgstr "" +msgid "%{jobs} job" +msgid_plural "%{jobs} jobs" +msgstr[0] "" +msgstr[1] "" msgid "%{key} is not a valid URL." msgstr "" diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index 4e41fff733d3492355262630569ac4df311640c1..ec7777e958f845ce035230da2635cd321e08bd8f 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -91,7 +91,7 @@ within_testid 'pipeline-details-header' do expect(page).to have_content("For #{pipeline.ref}") - expect(page).to have_content("#{pipeline.statuses.count} Jobs") + expect(page).to have_content("#{pipeline.statuses.count} jobs") expect(page).to have_link(pipeline.ref, href: project_commits_path(pipeline.project, pipeline.ref)) end @@ -666,7 +666,7 @@ visit_pipeline within_testid 'pipeline-details-header' do - expect(page).to have_content("#{pipeline.statuses.count} Jobs") + expect(page).to have_content("#{pipeline.statuses.count} jobs") expect(page).to have_content("Related merge request !#{merge_request.iid} " \ "to merge #{merge_request.source_branch}") expect(page).to have_link("!#{merge_request.iid}", @@ -700,7 +700,7 @@ it 'shows the pipeline information', :sidekiq_might_not_need_inline do within_testid 'pipeline-details-header' do - expect(page).to have_content("#{pipeline.statuses.count} Jobs") + expect(page).to have_content("#{pipeline.statuses.count} jobs") expect(page).to have_content("Related merge request !#{merge_request.iid} " \ "to merge #{merge_request.source_branch}") expect(page).to have_link("!#{merge_request.iid}", @@ -737,7 +737,7 @@ visit_pipeline within_testid 'pipeline-details-header' do - expect(page).to have_content("#{pipeline.statuses.count} Jobs") + expect(page).to have_content("#{pipeline.statuses.count} jobs") expect(page).to have_content("Related merge request !#{merge_request.iid} " \ "to merge #{merge_request.source_branch} " \ "into #{merge_request.target_branch}") @@ -774,7 +774,7 @@ it 'shows the pipeline information', :sidekiq_might_not_need_inline do within_testid 'pipeline-details-header' do - expect(page).to have_content("#{pipeline.statuses.count} Jobs") + expect(page).to have_content("#{pipeline.statuses.count} jobs") expect(page).to have_content("Related merge request !#{merge_request.iid} " \ "to merge #{merge_request.source_branch} " \ "into #{merge_request.target_branch}") diff --git a/spec/frontend/ci/pipeline_details/header/pipeline_details_header_spec.js b/spec/frontend/ci/pipeline_details/header/pipeline_details_header_spec.js index 86b8c416a07b7934bf61b649c3e1192da0d632f9..eeace44dd0174dd04faae23f50a2911133d5d856 100644 --- a/spec/frontend/ci/pipeline_details/header/pipeline_details_header_spec.js +++ b/spec/frontend/ci/pipeline_details/header/pipeline_details_header_spec.js @@ -147,7 +147,7 @@ describe('Pipeline details header', () => { }); it('displays total jobs', () => { - expect(findTotalJobs().text()).toBe('3 Jobs'); + expect(findTotalJobs().text()).toBe('3 jobs'); }); it('has link to commit', () => {