Commit e880ed94 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'alert-management-translations' into 'master'

Improve translations for Alert Management assignees

See merge request gitlab-org/gitlab!35841
parents 230adfd7 d931b1c3
...@@ -11,7 +11,7 @@ import { ...@@ -11,7 +11,7 @@ import {
GlSprintf, GlSprintf,
} from '@gitlab/ui'; } from '@gitlab/ui';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { s__ } from '~/locale'; import { s__, __ } from '~/locale';
import alertSetAssignees from '../../graphql/mutations/alert_set_assignees.graphql'; import alertSetAssignees from '../../graphql/mutations/alert_set_assignees.graphql';
import SidebarAssignee from './sidebar_assignee.vue'; import SidebarAssignee from './sidebar_assignee.vue';
import { debounce } from 'lodash'; import { debounce } from 'lodash';
...@@ -19,15 +19,18 @@ import { debounce } from 'lodash'; ...@@ -19,15 +19,18 @@ import { debounce } from 'lodash';
const DATA_REFETCH_DELAY = 250; const DATA_REFETCH_DELAY = 250;
export default { export default {
FETCH_USERS_ERROR: s__( i18n: {
'AlertManagement|There was an error while updating the assignee(s) list. Please try again.', FETCH_USERS_ERROR: s__(
), 'AlertManagement|There was an error while updating the assignee(s) list. Please try again.',
UPDATE_ALERT_ASSIGNEES_ERROR: s__( ),
'AlertManagement|There was an error while updating the assignee(s) of the alert. Please try again.', UPDATE_ALERT_ASSIGNEES_ERROR: s__(
), 'AlertManagement|There was an error while updating the assignee(s) of the alert. Please try again.',
UPDATE_ALERT_ASSIGNEES_GRAPHQL_ERROR: s__( ),
'AlertManagement|This assignee cannot be assigned to this alert.', UPDATE_ALERT_ASSIGNEES_GRAPHQL_ERROR: s__(
), 'AlertManagement|This assignee cannot be assigned to this alert.',
),
ASSIGNEES_BLOCK: s__('AlertManagement|Alert assignee(s): %{assignees}'),
},
components: { components: {
GlIcon, GlIcon,
GlDropdown, GlDropdown,
...@@ -80,7 +83,7 @@ export default { ...@@ -80,7 +83,7 @@ export default {
return this.alert?.assignees?.nodes[0]?.username; return this.alert?.assignees?.nodes[0]?.username;
}, },
assignedUser() { assignedUser() {
return this.userName || s__('AlertManagement|None'); return this.userName || __('None');
}, },
sortedUsers() { sortedUsers() {
return this.users return this.users
...@@ -142,7 +145,7 @@ export default { ...@@ -142,7 +145,7 @@ export default {
this.users = data; this.users = data;
}) })
.catch(() => { .catch(() => {
this.$emit('alert-error', this.$options.FETCH_USERS_ERROR); this.$emit('alert-error', this.$options.i18n.FETCH_USERS_ERROR);
}) })
.finally(() => { .finally(() => {
this.isDropdownSearching = false; this.isDropdownSearching = false;
...@@ -165,14 +168,14 @@ export default { ...@@ -165,14 +168,14 @@ export default {
if (errors[0]) { if (errors[0]) {
return this.$emit( return this.$emit(
'alert-sidebar-error', 'alert-sidebar-error',
`${this.$options.UPDATE_ALERT_ASSIGNEES_GRAPHQL_ERROR} ${errors[0]}.`, `${this.$options.i18n.UPDATE_ALERT_ASSIGNEES_GRAPHQL_ERROR} ${errors[0]}.`,
); );
} }
return this.$emit('alert-refresh'); return this.$emit('alert-refresh');
}) })
.catch(() => { .catch(() => {
this.$emit('alert-error', this.$options.UPDATE_ALERT_ASSIGNEES_ERROR); this.$emit('alert-error', this.$options.i18n.UPDATE_ALERT_ASSIGNEES_ERROR);
}) })
.finally(() => { .finally(() => {
this.isUpdating = false; this.isUpdating = false;
...@@ -189,7 +192,7 @@ export default { ...@@ -189,7 +192,7 @@ export default {
<gl-loading-icon v-if="isUpdating" /> <gl-loading-icon v-if="isUpdating" />
</div> </div>
<gl-tooltip :target="() => $refs.status" boundary="viewport" placement="left"> <gl-tooltip :target="() => $refs.status" boundary="viewport" placement="left">
<gl-sprintf :message="s__('AlertManagement|Alert assignee(s): %{assignees}')"> <gl-sprintf :message="$options.i18n.ASSIGNEES_BLOCK">
<template #assignees> <template #assignees>
{{ assignedUser }} {{ assignedUser }}
</template> </template>
...@@ -198,7 +201,7 @@ export default { ...@@ -198,7 +201,7 @@ export default {
<div class="hide-collapsed"> <div class="hide-collapsed">
<p class="title gl-display-flex gl-justify-content-space-between"> <p class="title gl-display-flex gl-justify-content-space-between">
{{ s__('AlertManagement|Assignee') }} {{ __('Assignee') }}
<a <a
v-if="isEditable" v-if="isEditable"
ref="editButton" ref="editButton"
...@@ -207,7 +210,7 @@ export default { ...@@ -207,7 +210,7 @@ export default {
@click="toggleFormDropdown" @click="toggleFormDropdown"
@keydown.esc="hideDropdown" @keydown.esc="hideDropdown"
> >
{{ s__('AlertManagement|Edit') }} {{ __('Edit') }}
</a> </a>
</p> </p>
...@@ -222,7 +225,7 @@ export default { ...@@ -222,7 +225,7 @@ export default {
@hide="hideDropdown" @hide="hideDropdown"
> >
<div class="dropdown-title"> <div class="dropdown-title">
<span class="alert-title">{{ s__('AlertManagement|Assign To') }}</span> <span class="alert-title">{{ __('Assign To') }}</span>
<gl-button <gl-button
:aria-label="__('Close')" :aria-label="__('Close')"
variant="link" variant="link"
...@@ -247,12 +250,12 @@ export default { ...@@ -247,12 +250,12 @@ export default {
active-class="is-active" active-class="is-active"
@click="updateAlertAssignees('')" @click="updateAlertAssignees('')"
> >
{{ s__('AlertManagement|Unassigned') }} {{ __('Unassigned') }}
</gl-dropdown-item> </gl-dropdown-item>
<gl-dropdown-divider /> <gl-dropdown-divider />
<gl-dropdown-header class="mt-0"> <gl-dropdown-header class="mt-0">
{{ s__('AlertManagement|Assignee') }} {{ __('Assignee') }}
</gl-dropdown-header> </gl-dropdown-header>
<sidebar-assignee <sidebar-assignee
v-for="user in sortedUsers" v-for="user in sortedUsers"
...@@ -263,7 +266,7 @@ export default { ...@@ -263,7 +266,7 @@ export default {
/> />
</template> </template>
<gl-dropdown-item v-else-if="userListEmpty"> <gl-dropdown-item v-else-if="userListEmpty">
{{ s__('AlertManagement|No Matching Results') }} {{ __('No Matching Results') }}
</gl-dropdown-item> </gl-dropdown-item>
<gl-loading-icon v-else /> <gl-loading-icon v-else />
</div> </div>
...@@ -276,7 +279,7 @@ export default { ...@@ -276,7 +279,7 @@ export default {
assignedUser assignedUser
}}</span> }}</span>
<span v-else class="gl-display-flex gl-align-items-center"> <span v-else class="gl-display-flex gl-align-items-center">
{{ s__('AlertManagement|None -') }} {{ __('None') }} -
<gl-button <gl-button
class="gl-pl-2" class="gl-pl-2"
href="#" href="#"
...@@ -284,7 +287,7 @@ export default { ...@@ -284,7 +287,7 @@ export default {
data-testid="unassigned-users" data-testid="unassigned-users"
@click="updateAlertAssignees(currentUser)" @click="updateAlertAssignees(currentUser)"
> >
{{ s__('AlertManagement| assign yourself') }} {{ __('assign yourself') }}
</gl-button> </gl-button>
</span> </span>
</p> </p>
......
...@@ -1905,9 +1905,6 @@ msgid_plural "Alerts" ...@@ -1905,9 +1905,6 @@ msgid_plural "Alerts"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "AlertManagement| assign yourself"
msgstr ""
msgid "AlertManagement|Acknowledged" msgid "AlertManagement|Acknowledged"
msgstr "" msgstr ""
...@@ -1932,15 +1929,9 @@ msgstr "" ...@@ -1932,15 +1929,9 @@ msgstr ""
msgid "AlertManagement|All alerts" msgid "AlertManagement|All alerts"
msgstr "" msgstr ""
msgid "AlertManagement|Assign To"
msgstr ""
msgid "AlertManagement|Assign status" msgid "AlertManagement|Assign status"
msgstr "" msgstr ""
msgid "AlertManagement|Assignee"
msgstr ""
msgid "AlertManagement|Assignees" msgid "AlertManagement|Assignees"
msgstr "" msgstr ""
...@@ -1980,9 +1971,6 @@ msgstr "" ...@@ -1980,9 +1971,6 @@ msgstr ""
msgid "AlertManagement|More information" msgid "AlertManagement|More information"
msgstr "" msgstr ""
msgid "AlertManagement|No Matching Results"
msgstr ""
msgid "AlertManagement|No alert data to display." msgid "AlertManagement|No alert data to display."
msgstr "" msgstr ""
...@@ -1995,9 +1983,6 @@ msgstr "" ...@@ -1995,9 +1983,6 @@ msgstr ""
msgid "AlertManagement|None" msgid "AlertManagement|None"
msgstr "" msgstr ""
msgid "AlertManagement|None -"
msgstr ""
msgid "AlertManagement|Open" msgid "AlertManagement|Open"
msgstr "" msgstr ""
...@@ -3077,6 +3062,9 @@ msgstr "" ...@@ -3077,6 +3062,9 @@ msgstr ""
msgid "Assign Iteration" msgid "Assign Iteration"
msgstr "" msgstr ""
msgid "Assign To"
msgstr ""
msgid "Assign custom color like #FF0000" msgid "Assign custom color like #FF0000"
msgstr "" msgstr ""
...@@ -15193,6 +15181,9 @@ msgstr "" ...@@ -15193,6 +15181,9 @@ msgstr ""
msgid "No Epic" msgid "No Epic"
msgstr "" msgstr ""
msgid "No Matching Results"
msgstr ""
msgid "No Scopes" msgid "No Scopes"
msgstr "" msgstr ""
...@@ -24548,6 +24539,9 @@ msgstr "" ...@@ -24548,6 +24539,9 @@ msgstr ""
msgid "Unassign from commenting user" msgid "Unassign from commenting user"
msgstr "" msgstr ""
msgid "Unassigned"
msgstr ""
msgid "Unblock" msgid "Unblock"
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