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 {
return this.author.id ? this.author.id : '';
},
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}`;
},
authorAvatar() {
......@@ -80,7 +82,7 @@ export default {
v-html="commit.title_html"
></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
v-if="commit.description_html"
......
<script>
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';
export default {
......@@ -54,11 +54,7 @@ export default {
},
methods: {
commitsText(version) {
return n__(
`${version.commits_count} commit,`,
`${version.commits_count} commits,`,
version.commits_count,
);
return n__(`%d commit,`, `%d commits,`, version.commits_count);
},
href(version) {
if (this.isBase(version)) {
......@@ -76,7 +72,7 @@ export default {
if (this.targetBranch && (this.isBase(version) || !version)) {
return this.targetBranch.branchName;
}
return `version ${version.version_index}`;
return sprintf(__(`version %{versionIndex}`), { versionIndex: version.version_index });
},
isActive(version) {
if (!version) {
......@@ -125,9 +121,9 @@ export default {
<div>
<strong>
{{ versionName(version) }}
<template v-if="isBase(version)">
(base)
</template>
<template v-if="isBase(version)">{{
s__('DiffsCompareBaseBranch|(base)')
}}</template>
</strong>
</div>
<div>
......
......@@ -151,21 +151,22 @@ export default {
<div v-if="forkMessageVisible" class="js-file-fork-suggestion-section file-fork-suggestion">
<span class="file-fork-suggestion-note">
You're not allowed to <span class="js-file-fork-suggestion-section-action">edit</span> files
in this project directly. Please fork this project, make your changes there, and submit a
merge request.
{{ 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."),
{ tag_start: '<span class="js-file-fork-suggestion-section-action">', tag_end: '</span>' })
}}
</span>
<a
:href="file.fork_path"
class="js-fork-suggestion-button btn btn-grouped btn-inverted btn-success"
>Fork</a
>{{ __('Fork') }}</a
>
<button
class="js-cancel-fork-suggestion-button btn btn-grouped"
type="button"
@click="hideForkMessage"
>
Cancel
{{ __('Cancel') }}
</button>
</div>
<gl-loading-icon v-if="showLoadingIcon" class="diff-content loading" />
......
......@@ -74,7 +74,7 @@ export default {
<button
v-if="discussionsExpanded"
type="button"
aria-label="Show comments"
:aria-label="__('Show comments')"
class="diff-notes-collapse js-diff-comment-avatar js-diff-comment-button"
@click="toggleDiscussions"
>
......
......@@ -41,6 +41,11 @@ msgid_plural "%d commits behind"
msgstr[0] ""
msgstr[1] ""
msgid "%d commit,"
msgid_plural "%d commits,"
msgstr[0] ""
msgstr[1] ""
msgid "%d commits"
msgstr ""
......@@ -3529,6 +3534,9 @@ msgstr ""
msgid "Diff limits"
msgstr ""
msgid "DiffsCompareBaseBranch|(base)"
msgstr ""
msgid "Diffs|No file name available"
msgstr ""
......@@ -9191,6 +9199,9 @@ msgstr ""
msgid "Show command"
msgstr ""
msgid "Show comments"
msgstr ""
msgid "Show comments only"
msgstr ""
......@@ -12684,6 +12695,9 @@ msgstr ""
msgid "verify ownership"
msgstr ""
msgid "version %{versionIndex}"
msgstr ""
msgid "via %{closed_via}"
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