Skip to content

Commit

Permalink
Fix translations for collaborator quick actions, correctly reference …
Browse files Browse the repository at this point in the history
…store and hide avatar images for screenreaders
  • Loading branch information
pascalwengerter committed Apr 28, 2021
1 parent 4e9e13d commit 07ce4b9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
:width="48"
:userid="collaborator.collaborator.name"
:user-name="collaborator.collaborator.displayName"
:aria-label="$gettext('User')"
/>
<div v-else key="collaborator-avatar-placeholder">
<oc-icon
Expand Down Expand Up @@ -141,8 +140,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 +151,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 +222,16 @@ export default {
return this.modifiable && !this.removalInProgress
},
editShareHint() {
let translated = this.$gettext('Edit share with %{ currentCollaborator }')
return this.$gettextInterpolate(translated, { currentCollaborator: this.collaborator.collaborator.displayName }, true)
},
deleteShareHint() {
let 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
3 changes: 1 addition & 2 deletions packages/web-runtime/src/components/Avatar.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<component :is="type" v-if="enabled">
<component :is="type" v-if="enabled" :aria-hidden="true">
<oc-spinner
v-if="loading"
key="avatar-loading"
:aria-label="$gettext('Loading user avatar')"
:style="`width: ${width}px; height: ${width}px;`"
/>
<oc-avatar
Expand Down

0 comments on commit 07ce4b9

Please sign in to comment.