summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorHasso Tepper <hasso.tepper@gmail.com>2015-08-14 14:50:25 +0300
committerHasso Tepper <hasso@zone.ee>2015-08-14 14:50:25 +0300
commit69c550ce51e845b93c351fc1ab120c3ff7654513 (patch)
treeff748cd71458d530abebb738fc77de6add8e893f /apps
parentddc7f668e59223d95cb42e4f0281d5dab5888d79 (diff)
downloadnextcloud-server-69c550ce51e845b93c351fc1ab120c3ff7654513.tar.gz
nextcloud-server-69c550ce51e845b93c351fc1ab120c3ff7654513.zip
Fix the string counting a selected files/dirs
The old one contains untranslatable ' & ' if both files and dirs are selected. The new code is especially designed to reuse strings from file listing summary view (apps/files/js/filesummary.js), so no translation is broken.
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js25
1 files changed, 16 insertions, 9 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 4802e07e965..a47dc28e9cd 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1941,16 +1941,23 @@
canDelete = (this.getDirectoryPermissions() & OC.PERMISSION_DELETE) && this.isSelectedDeletable();
this.$el.find('.selectedActions').removeClass('hidden');
this.$el.find('#headerSize a>span:first').text(OC.Util.humanFileSize(summary.totalSize));
- var selection = '';
- if (summary.totalDirs > 0) {
- selection += n('files', '%n folder', '%n folders', summary.totalDirs);
- if (summary.totalFiles > 0) {
- selection += ' & ';
- }
- }
- if (summary.totalFiles > 0) {
- selection += n('files', '%n file', '%n files', summary.totalFiles);
+
+ var directoryInfo = n('files', '%n folder', '%n folders', summary.totalDirs);
+ var fileInfo = n('files', '%n file', '%n files', summary.totalFiles);
+
+ var selectionVars = {
+ dirs: directoryInfo,
+ files: fileInfo
+ };
+
+ if (summary.totalDirs > 0 && summary.totalFiles > 0) {
+ var selection = t('files', '{dirs} and {files}', selectionVars);
+ } else if (summary.totalDirs > 0) {
+ var selection = directoryInfo;
+ } else {
+ var selection = fileInfo;
}
+
this.$el.find('#headerName a.name>span:first').text(selection);
this.$el.find('#modified a>span:first').text('');
this.$el.find('table').addClass('multiselect');