Skip to content

Commit

Permalink
Move edit/delete share hints into interpolate-translation functions, …
Browse files Browse the repository at this point in the history
…fix mapGetters
  • Loading branch information
pascalwengerter committed Apr 28, 2021
1 parent 4e9e13d commit 1b3d4b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
<div class="uk-flex uk-flex-nowrap uk-flex-middle">
<oc-button
v-if="$_editButtonVisible"
:aria-label="$gettext(`Edit share with ${ collaborator.collaborator.displayName }`)"
:uk-tooltip="$gettext(`Edit share with ${ collaborator.collaborator.displayName }`)"
:aria-label="editShareHint"
:uk-tooltip="editShareHint"
appearance="raw"
class="files-collaborators-collaborator-edit"
@click="$emit('onEdit', collaborator)"
Expand All @@ -152,8 +152,8 @@
<div>
<oc-button
v-if="$_deleteButtonVisible"
:aria-label="$gettext(`Delete share with ${ collaborator.collaborator.displayName }`)"
:uk-tooltip="$gettext(`Delete share with ${ collaborator.collaborator.displayName }`)"
:aria-label="deleteShareHint"
:uk-tooltip="deleteShareHint"
appearance="raw"
class="files-collaborators-collaborator-delete"
@click="$_removeShare"
Expand Down Expand Up @@ -223,6 +223,16 @@ export default {
return this.modifiable && !this.removalInProgress
},
editShareHint() {
const translated = this.$gettext('Edit share with ${ currentCollaborator }')
return this.$gettextInterpolate(translated, { currentCollaborator: this.collaborator.collaborator.displayName }, true)
},
deleteShareHint() {
const translated = this.$gettext('Delete share with ${ currentCollaborator }')
return this.$gettextInterpolate(translated, { currentCollaborator: this.collaborator.collaborator.displayName }, true)
},
isIndirectShare() {
// it is assumed that the "incoming" attribute only exists
// on shares coming from this.collaborator.sTree which are all indirect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default {
}),
computed: {
...mapGetters('Files', ['highlightedFile'], ['capabilities']),
...mapGetters('Files', ['highlightedFile', 'capabilities']),
copyLabel() {
return this.$gettext('Copy private link url')
Expand Down

0 comments on commit 1b3d4b9

Please sign in to comment.