Skip to content

Commit 33ff786

Browse files
committed
Use different wording when leaving the camp oneself
Fixes #7544
1 parent 685a9e5 commit 33ff786

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

frontend/src/components/collaborator/CollaboratorEdit.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
: onDialog
9595
"
9696
>
97-
{{ $tc('components.collaborator.collaboratorEdit.deactivate') }}
97+
{{ deactivateLabel }}
9898
</IconButton>
9999
</template>
100100
</PromptCollaboratorDeactivate>
@@ -179,6 +179,11 @@ export default {
179179
name() {
180180
return campCollaborationDisplayName(this.collaborator, this.$tc.bind(this), false)
181181
},
182+
deactivateLabel() {
183+
return this.isOwnCampCollaboration
184+
? this.$tc('components.collaborator.collaboratorEdit.leaveCamp')
185+
: this.$tc('components.collaborator.collaboratorEdit.deactivate')
186+
},
182187
},
183188
watch: {
184189
showDialog: function (showDialog) {

frontend/src/components/collaborator/PromptCollaboratorDeactivate.vue

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:error="error"
66
:submit-action="deactivateUser"
77
:submit-enabled="!$slots.error"
8-
:submit-label="$tc('components.collaborator.promptCollaboratorDeactivate.deactivate')"
8+
:submit-label="submitLabel"
99
submit-color="error"
1010
submit-icon="mdi-cancel"
1111
cancel-icon=""
@@ -16,11 +16,7 @@
1616
<slot name="activator" v-bind="scope" />
1717
</template>
1818
<slot>
19-
{{
20-
$tc('components.collaborator.promptCollaboratorDeactivate.warningText', 1, {
21-
name: displayName,
22-
})
23-
}}
19+
{{ warningText }}
2420
</slot>
2521
<template v-if="$slots.error || error" #error>
2622
<slot name="error">
@@ -36,6 +32,7 @@ import campCollaborationDisplayName from '@/common/helpers/campCollaborationDisp
3632
import { errorToMultiLineToast } from '@/components/toast/toasts'
3733
import PopoverPrompt from '@/components/prompt/PopoverPrompt.vue'
3834
import isOwnCampCollaboration from './isOwnCampCollaboration.js'
35+
import campShortTitle from '@/common/helpers/campShortTitle.js'
3936
4037
export default {
4138
name: 'PromptCollaboratorDeactivate',
@@ -51,6 +48,20 @@ export default {
5148
displayName() {
5249
return campCollaborationDisplayName(this.entity, this.$tc.bind(this))
5350
},
51+
submitLabel() {
52+
return this.isOwnCampCollaboration
53+
? this.$tc('components.collaborator.promptCollaboratorDeactivate.leaveCamp')
54+
: this.$tc('components.collaborator.promptCollaboratorDeactivate.deactivate')
55+
},
56+
warningText() {
57+
const key = this.isOwnCampCollaboration
58+
? 'components.collaborator.promptCollaboratorDeactivate.warningTextLeaveCamp'
59+
: 'components.collaborator.promptCollaboratorDeactivate.warningText'
60+
return this.$tc(key, 1, {
61+
name: this.displayName,
62+
camp: campShortTitle(this.entity.camp()),
63+
})
64+
},
5465
},
5566
created() {
5667
this.entityUri = this.entity._meta.self

frontend/src/locales/de.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@
246246
"cannotRemoveLastManager": "Du kannst die letzte Person mit administrativen Rechten nicht deaktivieren",
247247
"deactivate": "Deaktivieren",
248248
"delete": "Möchtest du die Person '{name}' wirklich entfernen?",
249+
"leaveCamp": "Lager verlassen",
249250
"inviteAgain": "Erneut einladen",
250251
"resendEmail": "E-Mail erneut senden",
251252
"resentEmail": "Einladung gesendet",
@@ -257,7 +258,9 @@
257258
},
258259
"promptCollaboratorDeactivate": {
259260
"deactivate": "Deaktivieren",
260-
"warningText": "Möchtest du '{name}' wirklich deaktivieren?"
261+
"leaveCamp": "Lager verlassen",
262+
"warningText": "Möchtest du '{name}' wirklich deaktivieren?",
263+
"warningTextLeaveCamp": "Möchtest du das Lager '{camp}' wirklich verlassen?"
261264
}
262265
},
263266
"dashboard": {

frontend/src/locales/en.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@
247247
"deactivate": "Deactivate",
248248
"delete": "Do you really want to remove collaborator '{name}'?",
249249
"inviteAgain": "Invite again",
250+
"leaveCamp": "Leave camp",
250251
"resendEmail": "Resend invite",
251252
"resentEmail": "Invitation sent",
252253
"title": "Edit {user}"
@@ -257,7 +258,9 @@
257258
},
258259
"promptCollaboratorDeactivate": {
259260
"deactivate": "Deactivate",
260-
"warningText": "Do you want to deactivate '{name}'?"
261+
"leaveCamp": "Leave camp",
262+
"warningText": "Do you want to deactivate '{name}'?",
263+
"warningTextLeaveCamp": "Do you want to leave the camp '{camp}'?"
261264
}
262265
},
263266
"dashboard": {

0 commit comments

Comments
 (0)