[TASK] Add translated reference count for files, folders and records 20/43620/2
authorWouter Wolters <typo3@wouterwolters.nl>
Mon, 28 Sep 2015 19:27:45 +0000 (21:27 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Tue, 29 Sep 2015 21:56:12 +0000 (23:56 +0200)
Resolves: #70160
Releases: master
Change-Id: I2e547d763356d53d341b9f6e1669aaf1f1351bfe
Reviewed-on: http://review.typo3.org/43620
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/filelist/Classes/FileList.php
typo3/sysext/lang/locallang_core.xlf

index a683c08..339c194 100644 (file)
@@ -779,7 +779,7 @@ class ClickMenu {
        public function DB_delete($table, $uid, $elInfo) {
                $loc = 'top.content.list_frame';
                if ($this->backendUser->jsConfirmation(JsConfirmation::DELETE)) {
-                       $conf = 'confirm(' . GeneralUtility::quoteJSvalue(sprintf($this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:mess.delete'), $elInfo[0]) . BackendUtility::referenceCount($table, $uid, ' (There are %s reference(s) to this record!)') . BackendUtility::translationCount($table, $uid, (' ' . $this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.translationsOfRecord')))) . ')';
+                       $conf = 'confirm(' . GeneralUtility::quoteJSvalue(sprintf($this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:mess.delete'), $elInfo[0]) . BackendUtility::referenceCount($table, $uid, ' ' . $this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.referencesToRecord')) . BackendUtility::translationCount($table, $uid, (' ' . $this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.translationsOfRecord')))) . ')';
                } else {
                        $conf = '1==1';
                }
@@ -1100,7 +1100,7 @@ class ClickMenu {
        public function FILE_delete($path) {
                $loc = 'top.content.list_frame';
                if ($this->backendUser->jsConfirmation(JsConfirmation::DELETE)) {
-                       $conf = 'confirm(' . GeneralUtility::quoteJSvalue((sprintf($this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:mess.delete'), basename($path)) . BackendUtility::referenceCount('_FILE', $path, ' (There are %s reference(s) to this file!)'))) . ')';
+                       $conf = 'confirm(' . GeneralUtility::quoteJSvalue((sprintf($this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:mess.delete'), basename($path)) . BackendUtility::referenceCount('_FILE', $path, ' ' . $this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.referencesToFile')))) . ')';
                } else {
                        $conf = '1==1';
                }
index a4133fd..0ee0a43 100644 (file)
@@ -958,9 +958,9 @@ class FileList extends AbstractRecordList {
                if ($fileOrFolderObject->checkActionPermission('delete')) {
                        $identifier = $fileOrFolderObject->getIdentifier();
                        if ($fileOrFolderObject instanceof Folder) {
-                               $referenceCountText = BackendUtility::referenceCount('_FILE', $identifier, ' (There are %s reference(s) to this folder!)');
+                               $referenceCountText = BackendUtility::referenceCount('_FILE', $identifier, ' ' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.referencesToFolder'));
                        } else {
-                               $referenceCountText = BackendUtility::referenceCount('sys_file', $fileOrFolderObject->getUid(), ' (There are %s reference(s) to this file!)');
+                               $referenceCountText = BackendUtility::referenceCount('sys_file', $fileOrFolderObject->getUid(), ' ' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.referencesToFile'));
                        }
 
                        if ($this->getBackendUser()->jsConfirmation(JsConfirmation::DELETE)) {
index 535a3b9..15177fb 100644 (file)
@@ -388,6 +388,12 @@ Do you want to continue WITHOUT saving?</source>
                        <trans-unit id="labels.referencesToRecord">
                                <source>(There are %s reference(s) to this record!)</source>
                        </trans-unit>
+                       <trans-unit id="labels.referencesToFolder">
+                               <source>(There are %s reference(s) to this folder!)</source>
+                       </trans-unit>
+                       <trans-unit id="labels.referencesToFile">
+                               <source>(There are %s reference(s) to this file!)</source>
+                       </trans-unit>
                        <trans-unit id="labels.translationsOfRecord">
                                <source>(This record has %s translation(s) which will be deleted, too!)</source>
                        </trans-unit>