Commit 656bac08 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo Committed by Filipa Lacerda

Vue-i18n: app/assets/javascripts/sidebar directory

i18n linting for .vue files under the
app/assets/javascripts/sidebar directory
parent 7ffacaae
<script> <script>
import { n__ } from '~/locale';
export default { export default {
name: 'AssigneeTitle', name: 'AssigneeTitle',
props: { props: {
...@@ -24,7 +26,7 @@ export default { ...@@ -24,7 +26,7 @@ export default {
computed: { computed: {
assigneeTitle() { assigneeTitle() {
const assignees = this.numberOfAssignees; const assignees = this.numberOfAssignees;
return assignees > 1 ? `${assignees} Assignees` : 'Assignee'; return n__('Assignee', `%d Assignees`, assignees);
}, },
}, },
}; };
...@@ -32,18 +34,18 @@ export default { ...@@ -32,18 +34,18 @@ export default {
<template> <template>
<div class="title hide-collapsed"> <div class="title hide-collapsed">
{{ assigneeTitle }} {{ assigneeTitle }}
<i v-if="loading" aria-hidden="true" class="fa fa-spinner fa-spin block-loading"> </i> <i v-if="loading" aria-hidden="true" class="fa fa-spinner fa-spin block-loading"></i>
<a v-if="editable" class="js-sidebar-dropdown-toggle edit-link float-right" href="#"> <a v-if="editable" class="js-sidebar-dropdown-toggle edit-link float-right" href="#">
{{ __('Edit') }} {{ __('Edit') }}
</a> </a>
<a <a
v-if="showToggle" v-if="showToggle"
aria-label="Toggle sidebar" :aria-label="__('Toggle sidebar')"
class="gutter-toggle float-right js-sidebar-toggle" class="gutter-toggle float-right js-sidebar-toggle"
href="#" href="#"
role="button" role="button"
> >
<i aria-hidden="true" data-hidden="true" class="fa fa-angle-double-right"> </i> <i aria-hidden="true" data-hidden="true" class="fa fa-angle-double-right"></i>
</a> </a>
</div> </div>
</template> </template>
<script> <script>
import { __ } from '~/locale'; import { __, sprintf } from '~/locale';
import tooltip from '~/vue_shared/directives/tooltip'; import tooltip from '~/vue_shared/directives/tooltip';
export default { export default {
...@@ -62,7 +62,8 @@ export default { ...@@ -62,7 +62,8 @@ export default {
return this.numberOfHiddenAssignees > 0; return this.numberOfHiddenAssignees > 0;
}, },
hiddenAssigneesLabel() { hiddenAssigneesLabel() {
return `+ ${this.numberOfHiddenAssignees} more`; const { numberOfHiddenAssignees } = this;
return sprintf(__('+ %{numberOfHiddenAssignees} more'), { numberOfHiddenAssignees });
}, },
collapsedTooltipTitle() { collapsedTooltipTitle() {
const maxRender = Math.min(this.defaultRenderCount, this.users.length); const maxRender = Math.min(this.defaultRenderCount, this.users.length);
...@@ -103,12 +104,15 @@ export default { ...@@ -103,12 +104,15 @@ export default {
// Everyone can merge // Everyone can merge
return null; return null;
} else if (cannotMergeCount === assigneesCount && assigneesCount > 1) { } else if (cannotMergeCount === assigneesCount && assigneesCount > 1) {
return 'No one can merge'; return __('No one can merge');
} else if (assigneesCount === 1) { } else if (assigneesCount === 1) {
return 'Cannot merge'; return __('Cannot merge');
} }
return `${canMergeCount}/${assigneesCount} can merge`; return sprintf(__('%{canMergeCount}/%{assigneesCount} can merge'), {
canMergeCount,
assigneesCount,
});
}, },
}, },
methods: { methods: {
...@@ -128,7 +132,7 @@ export default { ...@@ -128,7 +132,7 @@ export default {
return `${this.rootPath}${user.username}`; return `${this.rootPath}${user.username}`;
}, },
assigneeAlt(user) { assigneeAlt(user) {
return `${user.name}'s avatar`; return sprintf(__("%{userName}'s avatar"), { userName: user.name });
}, },
assigneeUsername(user) { assigneeUsername(user) {
return `@${user.username}`; return `@${user.username}`;
...@@ -153,7 +157,7 @@ export default { ...@@ -153,7 +157,7 @@ export default {
data-placement="left" data-placement="left"
data-boundary="viewport" data-boundary="viewport"
> >
<i v-if="hasNoUsers" aria-label="None" class="fa fa-user"> </i> <i v-if="hasNoUsers" :aria-label="__('None')" class="fa fa-user"> </i>
<button <button
v-for="(user, index) in users" v-for="(user, index) in users"
v-if="shouldRenderCollapsedAssignee(index)" v-if="shouldRenderCollapsedAssignee(index)"
...@@ -185,9 +189,12 @@ export default { ...@@ -185,9 +189,12 @@ export default {
</span> </span>
<template v-if="hasNoUsers"> <template v-if="hasNoUsers">
<span class="assign-yourself no-value qa-assign-yourself"> <span class="assign-yourself no-value qa-assign-yourself">
None {{ __('None') }}
<template v-if="editable"> <template v-if="editable">
- <button type="button" class="btn-link" @click="assignSelf">assign yourself</button> -
<button type="button" class="btn-link" @click="assignSelf">
{{ __('assign yourself') }}
</button>
</template> </template>
</span> </span>
</template> </template>
...@@ -232,9 +239,7 @@ export default { ...@@ -232,9 +239,7 @@ export default {
<template v-if="showLess"> <template v-if="showLess">
{{ hiddenAssigneesLabel }} {{ hiddenAssigneesLabel }}
</template> </template>
<template v-else> <template v-else>{{ __('- show less') }}</template>
- show less
</template>
</button> </button>
</div> </div>
</template> </template>
......
...@@ -4,6 +4,7 @@ import eventHub from '~/sidebar/event_hub'; ...@@ -4,6 +4,7 @@ import eventHub from '~/sidebar/event_hub';
import Store from '~/sidebar/stores/sidebar_store'; import Store from '~/sidebar/stores/sidebar_store';
import AssigneeTitle from './assignee_title.vue'; import AssigneeTitle from './assignee_title.vue';
import Assignees from './assignees.vue'; import Assignees from './assignees.vue';
import { __ } from '~/locale';
export default { export default {
name: 'SidebarAssignees', name: 'SidebarAssignees',
...@@ -74,7 +75,7 @@ export default { ...@@ -74,7 +75,7 @@ export default {
.then(setLoadingFalse.bind(this)) .then(setLoadingFalse.bind(this))
.catch(() => { .catch(() => {
setLoadingFalse(); setLoadingFalse();
return new Flash('Error occurred when saving assignees'); return new Flash(__('Error occurred when saving assignees'));
}); });
}, },
}, },
......
<script> <script>
import $ from 'jquery'; import $ from 'jquery';
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
import { __ } from '~/locale';
export default { export default {
props: { props: {
...@@ -15,7 +16,7 @@ export default { ...@@ -15,7 +16,7 @@ export default {
}, },
computed: { computed: {
toggleButtonText() { toggleButtonText() {
return this.isConfidential ? 'Turn Off' : 'Turn On'; return this.isConfidential ? __('Turn Off') : __('Turn On');
}, },
updateConfidentialBool() { updateConfidentialBool() {
return !this.isConfidential; return !this.isConfidential;
......
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
} else if (this.showSpentOnlyState) { } else if (this.showSpentOnlyState) {
return `${this.timeSpent} / --`; return `${this.timeSpent} / --`;
} else if (this.showNoTimeTrackingState) { } else if (this.showNoTimeTrackingState) {
return 'None'; return __('None');
} }
return ''; return '';
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import { parseSeconds, stringifyTime } from '~/lib/utils/datetime_utility'; import { parseSeconds, stringifyTime } from '~/lib/utils/datetime_utility';
import tooltip from '../../../vue_shared/directives/tooltip'; import tooltip from '../../../vue_shared/directives/tooltip';
import { GlProgressBar } from '@gitlab/ui'; import { GlProgressBar } from '@gitlab/ui';
import { s__, sprintf } from '~/locale';
export default { export default {
name: 'TimeTrackingComparisonPane', name: 'TimeTrackingComparisonPane',
...@@ -43,8 +44,14 @@ export default { ...@@ -43,8 +44,14 @@ export default {
return stringifyTime(this.parsedTimeRemaining); return stringifyTime(this.parsedTimeRemaining);
}, },
timeRemainingTooltip() { timeRemainingTooltip() {
const prefix = this.timeRemainingMinutes < 0 ? 'Over by' : 'Time remaining:'; const { timeRemainingHumanReadable, timeRemainingMinutes } = this;
return `${prefix} ${this.timeRemainingHumanReadable}`; return timeRemainingMinutes < 0
? sprintf(s__('TimeTracking|Over by %{timeRemainingHumanReadable}'), {
timeRemainingHumanReadable,
})
: sprintf(s__('TimeTracking|Time remaining: %{timeRemainingHumanReadable}'), {
timeRemainingHumanReadable,
});
}, },
/* Diff values for comparison meter */ /* Diff values for comparison meter */
timeRemainingMinutes() { timeRemainingMinutes() {
...@@ -74,12 +81,12 @@ export default { ...@@ -74,12 +81,12 @@ export default {
<gl-progress-bar :value="timeRemainingPercent" :variant="progressBarVariant" /> <gl-progress-bar :value="timeRemainingPercent" :variant="progressBarVariant" />
<div class="compare-display-container"> <div class="compare-display-container">
<div class="compare-display float-left"> <div class="compare-display float-left">
<span class="compare-label"> {{ s__('TimeTracking|Spent') }} </span> <span class="compare-label">{{ s__('TimeTracking|Spent') }}</span>
<span class="compare-value spent"> {{ timeSpentHumanReadable }} </span> <span class="compare-value spent">{{ timeSpentHumanReadable }}</span>
</div> </div>
<div class="compare-display estimated float-right"> <div class="compare-display estimated float-right">
<span class="compare-label"> {{ s__('TimeTrackingEstimated|Est') }} </span> <span class="compare-label">{{ s__('TimeTrackingEstimated|Est') }}</span>
<span class="compare-value"> {{ timeEstimateHumanReadable }} </span> <span class="compare-value">{{ timeEstimateHumanReadable }}</span>
</div> </div>
</div> </div>
</div> </div>
......
<script> <script>
import { sprintf, s__ } from '~/locale';
export default { export default {
name: 'TimeTrackingSpentOnlyPane', name: 'TimeTrackingSpentOnlyPane',
props: { props: {
...@@ -7,11 +9,22 @@ export default { ...@@ -7,11 +9,22 @@ export default {
required: true, required: true,
}, },
}, },
computed: {
timeSpent() {
return sprintf(
s__('TimeTracking|%{startTag}Spent: %{endTag}%{timeSpentHumanReadable}'),
{
startTag: '<span class="bold">',
endTag: '</span>',
timeSpentHumanReadable: this.timeSpentHumanReadable,
},
false,
);
},
},
}; };
</script> </script>
<template> <template>
<div class="time-tracking-spend-only-pane"> <div class="time-tracking-spend-only-pane" v-html="timeSpent"></div>
<span class="bold">Spent:</span> {{ timeSpentHumanReadable }}
</div>
</template> </template>
...@@ -118,6 +118,9 @@ msgstr[1] "" ...@@ -118,6 +118,9 @@ msgstr[1] ""
msgid "%{actionText} & %{openOrClose} %{noteable}" msgid "%{actionText} & %{openOrClose} %{noteable}"
msgstr "" msgstr ""
msgid "%{canMergeCount}/%{assigneesCount} can merge"
msgstr ""
msgid "%{commit_author_link} authored %{commit_timeago}" msgid "%{commit_author_link} authored %{commit_timeago}"
msgstr "" msgstr ""
...@@ -260,6 +263,9 @@ msgstr "" ...@@ -260,6 +263,9 @@ msgstr ""
msgid "%{usage_ping_link_start}Learn more%{usage_ping_link_end} about what information is shared with GitLab Inc." msgid "%{usage_ping_link_start}Learn more%{usage_ping_link_end} about what information is shared with GitLab Inc."
msgstr "" msgstr ""
msgid "%{userName}'s avatar"
msgstr ""
msgid "%{user_name} profile page" msgid "%{user_name} profile page"
msgstr "" msgstr ""
...@@ -284,6 +290,9 @@ msgstr "" ...@@ -284,6 +290,9 @@ msgstr ""
msgid "+ %{moreCount} more" msgid "+ %{moreCount} more"
msgstr "" msgstr ""
msgid "+ %{numberOfHiddenAssignees} more"
msgstr ""
msgid ", or " msgid ", or "
msgstr "" msgstr ""
...@@ -1335,7 +1344,9 @@ msgid "Assigned to me" ...@@ -1335,7 +1344,9 @@ msgid "Assigned to me"
msgstr "" msgstr ""
msgid "Assignee" msgid "Assignee"
msgstr "" msgid_plural "%d Assignees"
msgstr[0] ""
msgstr[1] ""
msgid "Assignee(s)" msgid "Assignee(s)"
msgstr "" msgstr ""
...@@ -1906,6 +1917,9 @@ msgstr "" ...@@ -1906,6 +1917,9 @@ msgstr ""
msgid "Cannot create the abuse report. This user has been blocked." msgid "Cannot create the abuse report. This user has been blocked."
msgstr "" msgstr ""
msgid "Cannot merge"
msgstr ""
msgid "Cannot modify managed Kubernetes cluster" msgid "Cannot modify managed Kubernetes cluster"
msgstr "" msgstr ""
...@@ -4244,6 +4258,9 @@ msgstr "" ...@@ -4244,6 +4258,9 @@ msgstr ""
msgid "Error occurred when fetching sidebar data" msgid "Error occurred when fetching sidebar data"
msgstr "" msgstr ""
msgid "Error occurred when saving assignees"
msgstr ""
msgid "Error occurred when toggling the notification subscription" msgid "Error occurred when toggling the notification subscription"
msgstr "" msgstr ""
...@@ -6867,6 +6884,9 @@ msgstr "" ...@@ -6867,6 +6884,9 @@ msgstr ""
msgid "No milestones to show" msgid "No milestones to show"
msgstr "" msgstr ""
msgid "No one can merge"
msgstr ""
msgid "No other labels with such name or description" msgid "No other labels with such name or description"
msgstr "" msgstr ""
...@@ -10906,12 +10926,21 @@ msgstr "" ...@@ -10906,12 +10926,21 @@ msgstr ""
msgid "TimeTrackingEstimated|Est" msgid "TimeTrackingEstimated|Est"
msgstr "" msgstr ""
msgid "TimeTracking|%{startTag}Spent: %{endTag}%{timeSpentHumanReadable}"
msgstr ""
msgid "TimeTracking|Estimated:" msgid "TimeTracking|Estimated:"
msgstr "" msgstr ""
msgid "TimeTracking|Over by %{timeRemainingHumanReadable}"
msgstr ""
msgid "TimeTracking|Spent" msgid "TimeTracking|Spent"
msgstr "" msgstr ""
msgid "TimeTracking|Time remaining: %{timeRemainingHumanReadable}"
msgstr ""
msgid "Timeago|%s days ago" msgid "Timeago|%s days ago"
msgstr "" msgstr ""
...@@ -11177,6 +11206,9 @@ msgstr "" ...@@ -11177,6 +11206,9 @@ msgstr ""
msgid "Toggle navigation" msgid "Toggle navigation"
msgstr "" msgstr ""
msgid "Toggle sidebar"
msgstr ""
msgid "Toggle thread" msgid "Toggle thread"
msgstr "" msgstr ""
...@@ -11294,6 +11326,12 @@ msgstr "" ...@@ -11294,6 +11326,12 @@ msgstr ""
msgid "Tuesday" msgid "Tuesday"
msgstr "" msgstr ""
msgid "Turn Off"
msgstr ""
msgid "Turn On"
msgstr ""
msgid "Twitter" msgid "Twitter"
msgstr "" msgstr ""
...@@ -12493,6 +12531,9 @@ msgstr "" ...@@ -12493,6 +12531,9 @@ msgstr ""
msgid "among other things" msgid "among other things"
msgstr "" msgstr ""
msgid "assign yourself"
msgstr ""
msgid "attach a new file" msgid "attach a new file"
msgstr "" 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