Skip to content

Commit

Permalink
Change breadcrum hint pluralization & change span to p tag
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwengerter committed May 31, 2021
1 parent 74dd1c4 commit dcbf119
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/web-app-files/src/mixins/accessibleBreadcrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ export default {
)
const activeBreadcrumbItem = activeBreadcrumb.lastChild

const announcement = this.$gettextInterpolate(
'containing %{filesCount} files and %{folderCount} folders',
{ filesCount: this.activeFilesCount.files, folderCount: this.activeFilesCount.folders }
const itemCount = this.activeFilesCount.files + this.activeFilesCount.folders
const announcement = this.$ngettext(
'This folder contains %{ itemCount } item.',
'This folder contains %{ itemCount } items.',
itemCount
)

const translatedHint =
this.activeFilesCount.folders > 0 || this.activeFilesCount.files > 0
? announcement
: this.$gettext('This folder has no content')
: this.$gettext('This folder has no content.')

document.querySelectorAll('.oc-breadcrumb-sr').forEach(el => el.remove())

const invisibleHint = document.createElement('span')
const invisibleHint = document.createElement('p')
invisibleHint.className = 'oc-invisible-sr oc-breadcrumb-sr'
invisibleHint.innerHTML = translatedHint

Expand Down

0 comments on commit dcbf119

Please sign in to comment.