Commit 9a18b275 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo Committed by Clement Ho

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

i18n linting for .vue files under the
app/assets/javascripts/environments directory
parent 7177f59f
<script> <script>
import { s__, sprintf } from '~/locale'; import { __, s__, sprintf } from '~/locale';
import { formatTime } from '~/lib/utils/datetime_utility'; import { formatTime } from '~/lib/utils/datetime_utility';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
}, },
computed: { computed: {
title() { title() {
return 'Deploy to...'; return __('Deploy to...');
}, },
}, },
methods: { methods: {
...@@ -80,7 +80,8 @@ export default { ...@@ -80,7 +80,8 @@ export default {
data-toggle="dropdown" data-toggle="dropdown"
> >
<span> <span>
<icon name="play" /> <icon name="chevron-down" /> <icon name="play" />
<icon name="chevron-down" />
<gl-loading-icon v-if="isLoading" /> <gl-loading-icon v-if="isLoading" />
</span> </span>
</button> </button>
...@@ -94,9 +95,10 @@ export default { ...@@ -94,9 +95,10 @@ export default {
class="js-manual-action-link no-btn btn d-flex align-items-center" class="js-manual-action-link no-btn btn d-flex align-items-center"
@click="onClickAction(action)" @click="onClickAction(action)"
> >
<span class="flex-fill"> {{ action.name }} </span> <span class="flex-fill">{{ action.name }}</span>
<span v-if="action.scheduledAt" class="text-secondary"> <span v-if="action.scheduledAt" class="text-secondary">
<icon name="clock" /> {{ remainingTime(action) }} <icon name="clock" />
{{ remainingTime(action) }}
</span> </span>
</button> </button>
</li> </li>
......
<script> <script>
import { __, sprintf } from '~/locale';
import Timeago from 'timeago.js'; import Timeago from 'timeago.js';
import _ from 'underscore'; import _ from 'underscore';
import { GlTooltipDirective } from '@gitlab/ui'; import { GlTooltipDirective } from '@gitlab/ui';
...@@ -172,7 +173,9 @@ export default { ...@@ -172,7 +173,9 @@ export default {
this.model.last_deployment.user && this.model.last_deployment.user &&
this.model.last_deployment.user.username this.model.last_deployment.user.username
) { ) {
return `${this.model.last_deployment.user.username}'s avatar'`; return sprintf(__("%{username}'s avatar"), {
username: this.model.last_deployment.user.username,
});
} }
return ''; return '';
}, },
...@@ -293,6 +296,9 @@ export default { ...@@ -293,6 +296,9 @@ export default {
* @returns {Boolean|Undefined} * @returns {Boolean|Undefined}
*/ */
isLastDeployment() { isLastDeployment() {
// TODO: when the vue i18n rules are merged need to disable @gitlab/i18n/no-non-i18n-strings
// name: 'last?' is a false positive: https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/26#possible-false-positives
// Vue i18n ESLint rules issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/63560
return this.model && this.model.last_deployment && this.model.last_deployment['last?']; return this.model && this.model.last_deployment && this.model.last_deployment['last?'];
}, },
......
<script> <script>
import { __ } from '~/locale';
/** /**
* Renders the Monitoring (Metrics) link in environments table. * Renders the Monitoring (Metrics) link in environments table.
*/ */
...@@ -21,7 +22,7 @@ export default { ...@@ -21,7 +22,7 @@ export default {
}, },
computed: { computed: {
title() { title() {
return 'Monitoring'; return __('Monitoring');
}, },
}, },
}; };
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
*/ */
import { GlTooltipDirective } from '@gitlab/ui'; import { GlTooltipDirective } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { __ } from '~/locale';
export default { export default {
components: { components: {
...@@ -27,7 +28,7 @@ export default { ...@@ -27,7 +28,7 @@ export default {
}, },
computed: { computed: {
title() { title() {
return 'Terminal'; return __('Terminal');
}, },
}, },
}; };
......
...@@ -3485,6 +3485,9 @@ msgstr "" ...@@ -3485,6 +3485,9 @@ msgstr ""
msgid "Deploy key was successfully updated." msgid "Deploy key was successfully updated."
msgstr "" msgstr ""
msgid "Deploy to..."
msgstr ""
msgid "DeployKeys|+%{count} others" msgid "DeployKeys|+%{count} others"
msgstr "" msgstr ""
...@@ -10163,6 +10166,9 @@ msgstr "" ...@@ -10163,6 +10166,9 @@ msgstr ""
msgid "Templates" msgid "Templates"
msgstr "" msgstr ""
msgid "Terminal"
msgstr ""
msgid "Terminal for environment" msgid "Terminal for environment"
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