Commit 8057ac75 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo Committed by Phil Hughes

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

i18n linting for .vue files under the
app/assets/javascripts/diffs directory
parent 36db790a
...@@ -49,6 +49,8 @@ export default { ...@@ -49,6 +49,8 @@ export default {
return this.author.id ? this.author.id : ''; return this.author.id ? this.author.id : '';
}, },
authorUrl() { authorUrl() {
// TODO: when the vue i18n rules are merged need to disable @gitlab/i18n/no-non-i18n-strings
// name: 'mailto:' is a false positive: https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/26#possible-false-positives
return this.author.web_url || `mailto:${this.commit.author_email}`; return this.author.web_url || `mailto:${this.commit.author_email}`;
}, },
authorAvatar() { authorAvatar() {
...@@ -80,7 +82,7 @@ export default { ...@@ -80,7 +82,7 @@ export default {
v-html="commit.title_html" v-html="commit.title_html"
></a> ></a>
<span class="commit-row-message d-block d-sm-none"> &middot; {{ commit.short_id }} </span> <span class="commit-row-message d-block d-sm-none">&middot; {{ commit.short_id }}</span>
<button <button
v-if="commit.description_html" v-if="commit.description_html"
......
<script> <script>
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { n__, __ } from '~/locale'; import { n__, __, sprintf } from '~/locale';
import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue';
export default { export default {
...@@ -54,11 +54,7 @@ export default { ...@@ -54,11 +54,7 @@ export default {
}, },
methods: { methods: {
commitsText(version) { commitsText(version) {
return n__( return n__(`%d commit,`, `%d commits,`, version.commits_count);
`${version.commits_count} commit,`,
`${version.commits_count} commits,`,
version.commits_count,
);
}, },
href(version) { href(version) {
if (this.isBase(version)) { if (this.isBase(version)) {
...@@ -76,7 +72,7 @@ export default { ...@@ -76,7 +72,7 @@ export default {
if (this.targetBranch && (this.isBase(version) || !version)) { if (this.targetBranch && (this.isBase(version) || !version)) {
return this.targetBranch.branchName; return this.targetBranch.branchName;
} }
return `version ${version.version_index}`; return sprintf(__(`version %{versionIndex}`), { versionIndex: version.version_index });
}, },
isActive(version) { isActive(version) {
if (!version) { if (!version) {
...@@ -125,9 +121,9 @@ export default { ...@@ -125,9 +121,9 @@ export default {
<div> <div>
<strong> <strong>
{{ versionName(version) }} {{ versionName(version) }}
<template v-if="isBase(version)"> <template v-if="isBase(version)">{{
(base) s__('DiffsCompareBaseBranch|(base)')
</template> }}</template>
</strong> </strong>
</div> </div>
<div> <div>
......
...@@ -151,21 +151,22 @@ export default { ...@@ -151,21 +151,22 @@ export default {
<div v-if="forkMessageVisible" class="js-file-fork-suggestion-section file-fork-suggestion"> <div v-if="forkMessageVisible" class="js-file-fork-suggestion-section file-fork-suggestion">
<span class="file-fork-suggestion-note"> <span class="file-fork-suggestion-note">
You're not allowed to <span class="js-file-fork-suggestion-section-action">edit</span> files {{ sprintf(__("You're not allowed to %{tag_start}edit%{tag_end} files in this project
in this project directly. Please fork this project, make your changes there, and submit a directly. Please fork this project, make your changes there, and submit a merge request."),
merge request. { tag_start: '<span class="js-file-fork-suggestion-section-action">', tag_end: '</span>' })
}}
</span> </span>
<a <a
:href="file.fork_path" :href="file.fork_path"
class="js-fork-suggestion-button btn btn-grouped btn-inverted btn-success" class="js-fork-suggestion-button btn btn-grouped btn-inverted btn-success"
>Fork</a >{{ __('Fork') }}</a
> >
<button <button
class="js-cancel-fork-suggestion-button btn btn-grouped" class="js-cancel-fork-suggestion-button btn btn-grouped"
type="button" type="button"
@click="hideForkMessage" @click="hideForkMessage"
> >
Cancel {{ __('Cancel') }}
</button> </button>
</div> </div>
<gl-loading-icon v-if="showLoadingIcon" class="diff-content loading" /> <gl-loading-icon v-if="showLoadingIcon" class="diff-content loading" />
......
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
<button <button
v-if="discussionsExpanded" v-if="discussionsExpanded"
type="button" type="button"
aria-label="Show comments" :aria-label="__('Show comments')"
class="diff-notes-collapse js-diff-comment-avatar js-diff-comment-button" class="diff-notes-collapse js-diff-comment-avatar js-diff-comment-button"
@click="toggleDiscussions" @click="toggleDiscussions"
> >
......
...@@ -41,6 +41,11 @@ msgid_plural "%d commits behind" ...@@ -41,6 +41,11 @@ msgid_plural "%d commits behind"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "%d commit,"
msgid_plural "%d commits,"
msgstr[0] ""
msgstr[1] ""
msgid "%d commits" msgid "%d commits"
msgstr "" msgstr ""
...@@ -3529,6 +3534,9 @@ msgstr "" ...@@ -3529,6 +3534,9 @@ msgstr ""
msgid "Diff limits" msgid "Diff limits"
msgstr "" msgstr ""
msgid "DiffsCompareBaseBranch|(base)"
msgstr ""
msgid "Diffs|No file name available" msgid "Diffs|No file name available"
msgstr "" msgstr ""
...@@ -9191,6 +9199,9 @@ msgstr "" ...@@ -9191,6 +9199,9 @@ msgstr ""
msgid "Show command" msgid "Show command"
msgstr "" msgstr ""
msgid "Show comments"
msgstr ""
msgid "Show comments only" msgid "Show comments only"
msgstr "" msgstr ""
...@@ -12684,6 +12695,9 @@ msgstr "" ...@@ -12684,6 +12695,9 @@ msgstr ""
msgid "verify ownership" msgid "verify ownership"
msgstr "" msgstr ""
msgid "version %{versionIndex}"
msgstr ""
msgid "via %{closed_via}" msgid "via %{closed_via}"
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