Commit 29f4d3f2 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch '200110-refactor-translation-in-compare-versions' into 'master'

Refactor compare version component to use gl-sprintf

Closes #200110

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