diff --git a/app/assets/javascripts/diffs/components/diff_file.vue b/app/assets/javascripts/diffs/components/diff_file.vue index 0d5181d5720ee475913895eeaa4b1f26038f9e73..564d64c38c426c47a8488dd2a45f88ed769bb3af 100644 --- a/app/assets/javascripts/diffs/components/diff_file.vue +++ b/app/assets/javascripts/diffs/components/diff_file.vue @@ -3,7 +3,7 @@ import { mapActions, mapGetters, mapState } from 'vuex'; import { escape } from 'lodash'; import { GlLoadingIcon, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; -import { __, sprintf } from '~/locale'; +import { sprintf } from '~/locale'; import { deprecatedCreateFlash as createFlash } from '~/flash'; import { hasDiff } from '~/helpers/diffs_helper'; import eventHub from '../../notes/event_hub'; @@ -12,6 +12,7 @@ import DiffContent from './diff_content.vue'; import { diffViewerErrors } from '~/ide/constants'; import { collapsedType, isCollapsed } from '../diff_file'; import { DIFF_FILE_AUTOMATIC_COLLAPSE, DIFF_FILE_MANUAL_COLLAPSE } from '../constants'; +import { DIFF_FILE, GENERIC_ERROR } from '../i18n'; export default { components: { @@ -49,13 +50,17 @@ export default { isCollapsed: isCollapsed(this.file), }; }, + i18n: { + ...DIFF_FILE, + genericError: GENERIC_ERROR, + }, computed: { ...mapState('diffs', ['currentDiffFileId']), ...mapGetters(['isNotesFetched']), ...mapGetters('diffs', ['getDiffFileDiscussions']), viewBlobLink() { return sprintf( - __('You can %{linkStart}view the blob%{linkEnd} instead.'), + this.$options.i18n.blobView, { linkStart: ``, linkEnd: '', @@ -77,9 +82,7 @@ export default { }, forkMessage() { return sprintf( - __( - "You're not allowed to %{tag_start}edit%{tag_end} files in this project directly. Please fork this project, make your changes there, and submit a merge request.", - ), + this.$options.i18n.editInFork, { tag_start: '', tag_end: '', @@ -187,7 +190,7 @@ export default { }) .catch(() => { this.isLoadingCollapsedDiff = false; - createFlash(__('Something went wrong on our end. Please try again!')); + createFlash(this.$options.i18n.genericError); }); }, showForkMessage() { @@ -229,14 +232,14 @@ export default { {{ __('Fork') }}{{ $options.i18n.fork }} - {{ __('Cancel') }} + {{ $options.i18n.cancel }} @@ -255,14 +258,14 @@ export default { - {{ __('This diff is collapsed.') }} + {{ $options.i18n.collapsed }} - {{ __('Click to expand it.') }} + {{ $options.i18n.expand }}