diff options
author | Ezekiel Kigbo <ekigbo@gitlab.com> | 2019-06-26 07:33:14 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-06-26 07:33:14 +0000 |
commit | 8057ac7566dcf25682b2307d78488626f0ad64a6 (patch) | |
tree | cec88a448fc20b3d3a237a15b2f28985f0ca5e37 | |
parent | 36db790a179ef8267161fc3735a3f1474bbde485 (diff) | |
download | gitlab-ce-8057ac7566dcf25682b2307d78488626f0ad64a6.tar.gz |
Vue-i18n: app/assets/javascripts/diffs directory
i18n linting for .vue files under the
app/assets/javascripts/diffs directory
5 files changed, 30 insertions, 17 deletions
diff --git a/app/assets/javascripts/diffs/components/commit_item.vue b/app/assets/javascripts/diffs/components/commit_item.vue index aaa9f8b759a..58d5b658b17 100644 --- a/app/assets/javascripts/diffs/components/commit_item.vue +++ b/app/assets/javascripts/diffs/components/commit_item.vue @@ -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"> · {{ commit.short_id }} </span> + <span class="commit-row-message d-block d-sm-none">· {{ commit.short_id }}</span> <button v-if="commit.description_html" diff --git a/app/assets/javascripts/diffs/components/compare_versions_dropdown.vue b/app/assets/javascripts/diffs/components/compare_versions_dropdown.vue index 80aec84f574..1dcdb65d5c7 100644 --- a/app/assets/javascripts/diffs/components/compare_versions_dropdown.vue +++ b/app/assets/javascripts/diffs/components/compare_versions_dropdown.vue @@ -1,6 +1,6 @@ <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> diff --git a/app/assets/javascripts/diffs/components/diff_file.vue b/app/assets/javascripts/diffs/components/diff_file.vue index f5876a73eff..63350fafefa 100644 --- a/app/assets/javascripts/diffs/components/diff_file.vue +++ b/app/assets/javascripts/diffs/components/diff_file.vue @@ -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" /> diff --git a/app/assets/javascripts/diffs/components/diff_gutter_avatars.vue b/app/assets/javascripts/diffs/components/diff_gutter_avatars.vue index 7cf3d90d468..e28909b7be3 100644 --- a/app/assets/javascripts/diffs/components/diff_gutter_avatars.vue +++ b/app/assets/javascripts/diffs/components/diff_gutter_avatars.vue @@ -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" > diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 1a9e8ae7288..e2dff31efa2 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -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 "" |