Skip to content

Commit

Permalink
Merge pull request #42734 from nextcloud/backport/42716/stable28
Browse files Browse the repository at this point in the history
[stable28] fix(files): use getSummaryFor for better files summary translations
  • Loading branch information
artonge authored Jan 15, 2024
2 parents b768934 + 75ecdec commit 4eaf7e7
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 23 deletions.
18 changes: 4 additions & 14 deletions apps/files/src/components/FilesListVirtual.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ import { translate as t, translatePlural as n } from '@nextcloud/l10n'
import { defineComponent } from 'vue'
import { action as sidebarAction } from '../actions/sidebarAction.ts'
import { useUserConfigStore } from '../store/userconfig.ts'
import { getSummaryFor } from '../utils/fileUtils'
import { useSelectionStore } from '../store/selection.js'
import { useUserConfigStore } from '../store/userconfig.ts'
import FileEntry from './FileEntry.vue'
import FileEntryGrid from './FileEntryGrid.vue'
Expand Down Expand Up @@ -146,25 +147,14 @@ export default defineComponent({
return this.userConfigStore.userConfig
},
files() {
return this.nodes.filter(node => node.type === 'file')
},
fileId() {
return parseInt(this.$route.params.fileid) || null
},
summaryFile() {
const count = this.files.length
return n('files', '{count} file', '{count} files', count, { count })
},
summaryFolder() {
const count = this.nodes.length - this.files.length
return n('files', '{count} folder', '{count} folders', count, { count })
},
summary() {
return t('files', '{summaryFile} and {summaryFolder}', this)
return getSummaryFor(this.nodes)
},
isMtimeAvailable() {
// Hide mtime column on narrow screens
if (this.filesListWidth < 768) {
Expand Down
4 changes: 2 additions & 2 deletions dist/614-614.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/614-614.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-unsupported-browser.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-unsupported-browser.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

0 comments on commit 4eaf7e7

Please sign in to comment.