Commit 8e3737c2 authored by Samantha Ming's avatar Samantha Ming Committed by Paul Slaughter

Refactor translation to use gl-sprintf

parent 56550f91
<script> <script>
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { GlTooltipDirective, GlLink, GlButton } from '@gitlab/ui'; import { GlTooltipDirective, GlLink, GlButton, GlSprintf } from '@gitlab/ui';
import { __ } from '~/locale'; import { __ } from '~/locale';
import { polyfillSticky } from '~/lib/utils/sticky'; import { polyfillSticky } from '~/lib/utils/sticky';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
...@@ -15,6 +15,7 @@ export default { ...@@ -15,6 +15,7 @@ export default {
Icon, Icon,
GlLink, GlLink,
GlButton, GlButton,
GlSprintf,
SettingsDropdown, SettingsDropdown,
DiffStats, DiffStats,
}, },
...@@ -106,15 +107,20 @@ export default { ...@@ -106,15 +107,20 @@ export default {
> >
<icon name="file-tree" /> <icon name="file-tree" />
</button> </button>
<div v-if="showDropdowns" class="d-flex align-items-center compare-versions-container"> <gl-sprintf
{{ __('Compare') }} v-if="showDropdowns"
class="d-flex align-items-center compare-versions-container"
:message="s__('MergeRequest|Compare %{source} and %{target}')"
>
<template #source>
<compare-versions-dropdown <compare-versions-dropdown
:other-versions="mergeRequestDiffs" :other-versions="mergeRequestDiffs"
:merge-request-version="mergeRequestDiff" :merge-request-version="mergeRequestDiff"
:show-commit-count="true" :show-commit-count="true"
class="mr-version-dropdown" class="mr-version-dropdown"
/> />
{{ __('and') }} </template>
<template #target>
<compare-versions-dropdown <compare-versions-dropdown
:other-versions="comparableDiffs" :other-versions="comparableDiffs"
:base-version-path="baseVersionPath" :base-version-path="baseVersionPath"
...@@ -122,7 +128,8 @@ export default { ...@@ -122,7 +128,8 @@ export default {
:target-branch="targetBranch" :target-branch="targetBranch"
class="mr-version-compare-dropdown" class="mr-version-compare-dropdown"
/> />
</div> </template>
</gl-sprintf>
<div v-else-if="commit"> <div v-else-if="commit">
{{ __('Viewing commit') }} {{ __('Viewing commit') }}
<gl-link :href="commit.commit_url" class="monospace">{{ commit.short_id }}</gl-link> <gl-link :href="commit.commit_url" class="monospace">{{ commit.short_id }}</gl-link>
......
...@@ -11944,6 +11944,9 @@ msgstr "" ...@@ -11944,6 +11944,9 @@ msgstr ""
msgid "MergeRequests|started a thread on commit %{linkStart}%{commitDisplay}%{linkEnd}" msgid "MergeRequests|started a thread on commit %{linkStart}%{commitDisplay}%{linkEnd}"
msgstr "" msgstr ""
msgid "MergeRequest|Compare %{source} and %{target}"
msgstr ""
msgid "MergeRequest|Error dismissing suggestion popover. Please try again." msgid "MergeRequest|Error dismissing suggestion popover. Please try again."
msgstr "" msgstr ""
...@@ -22255,9 +22258,6 @@ msgstr "" ...@@ -22255,9 +22258,6 @@ msgstr ""
msgid "among other things" msgid "among other things"
msgstr "" msgstr ""
msgid "and"
msgstr ""
msgid "any-approver for the merge request already exists" msgid "any-approver for the merge request already exists"
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