Commit b086e422 authored by Josianne Hyson's avatar Josianne Hyson

Use plural translation method for project select

Although we will never hit the singular case for this string, we still
need to use the plural translation for languages that have different
plural forms when the value is greater than 1. For example Russian has
plural forms for one, few and many.
parent 04202bb9
......@@ -3,7 +3,7 @@ import $ from 'jquery';
import _ from 'underscore';
import { GlLoadingIcon, GlButton, GlAvatar } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
import { sprintf, s__, __ } from '~/locale';
import { n__, s__, __ } from '~/locale';
import Api from '~/api';
import { renderAvatar, renderIdenticon } from '~/helpers/avatar_helper';
......@@ -52,9 +52,11 @@ export default {
if (this.selectedProjects.length === 1) {
return this.selectedProjects[0].name;
} else if (this.selectedProjects.length > 1) {
return sprintf(s__('CycleAnalytics|%{projectCount} projects selected'), {
projectCount: this.selectedProjects.length,
});
return n__(
'CycleAnalytics|Project selected',
'CycleAnalytics|%d projects selected',
this.selectedProjects.length,
);
}
return this.selectedProjectsPlaceholder;
......
......@@ -5742,9 +5742,6 @@ msgstr ""
msgid "CycleAnalyticsStage|should be under a group"
msgstr ""
msgid "CycleAnalytics|%{projectCount} projects selected"
msgstr ""
msgid "CycleAnalytics|%{stageCount} stages selected"
msgstr ""
......@@ -5766,6 +5763,11 @@ msgstr ""
msgid "CycleAnalytics|Number of tasks"
msgstr ""
msgid "CycleAnalytics|Project selected"
msgid_plural "CycleAnalytics|%d projects selected"
msgstr[0] ""
msgstr[1] ""
msgid "CycleAnalytics|Select labels"
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment