From c597c01218e892dac824cf6b352f494070a0f64f Mon Sep 17 00:00:00 2001 From: Sybille Peters Date: Sat, 11 Jun 2022 14:07:56 +0200 Subject: [PATCH] [TASK] Add localization labels in BE module Resolves: #692 --- Classes/Controller/BackendController.php | 13 ++++++ Resources/Private/Language/locallang_mod.xlf | 43 ++++++++++++++++++- .../Private/Partials/Backend/Filter.html | 14 +++--- Resources/Private/Partials/Backend/List.html | 14 +++--- Resources/Private/Templates/Backend/List.html | 8 +++- 5 files changed, 76 insertions(+), 16 deletions(-) diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index 38c01e1b..ffeae32e 100644 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -11,6 +11,7 @@ use HDNET\Calendarize\Register; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; +use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Pagination\ArrayPaginator; use TYPO3\CMS\Core\Pagination\SimplePagination; use TYPO3\CMS\Extbase\Pagination\QueryResultPaginator; @@ -21,6 +22,9 @@ */ class BackendController extends AbstractController { + private const PATH_CALENDARIZE_LOCALLANG = 'LLL:EXT:calendarize/Resources/Private/Language/locallang_mod.xlf'; + private const PATH_CORE_LOCALLANG = 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf'; + protected $defaultViewObjectName = \TYPO3\CMS\Backend\View\BackendTemplateView::class; public const OPTIONS_KEY = 'calendarize_be'; @@ -79,6 +83,10 @@ public function listAction(OptionRequest $options = null, int $currentPage = 1) 'paginator' => $paginator, 'pagination' => $pagination, 'totalAmount' => \count($indices), + 'filterOptions' => [ + 'asc' => $this->getLanguageService()->sL(self::PATH_CORE_LOCALLANG . ':ascending') ?: 'ascending', + 'desc' => $this->getLanguageService()->sL(self::PATH_CORE_LOCALLANG . ':descending') ?: 'descending', + ], ]); } @@ -231,4 +239,9 @@ protected function getBackendUser(): BackendUserAuthentication { return $GLOBALS['BE_USER']; } + + protected function getLanguageService(): ?LanguageService + { + return $GLOBALS['LANG'] ?? null; + } } diff --git a/Resources/Private/Language/locallang_mod.xlf b/Resources/Private/Language/locallang_mod.xlf index 62d55160..70cb101d 100644 --- a/Resources/Private/Language/locallang_mod.xlf +++ b/Resources/Private/Language/locallang_mod.xlf @@ -13,6 +13,45 @@ Calendarize - - + + on + + + Note: If you create first events in Storage folder, the create buttons will appear in this location + + + Page + + + Type + + + Sorting + + + Save options + + + items + + + Title + + + Date + + + Type + + + Language + + + ID + + + Action + + + diff --git a/Resources/Private/Partials/Backend/Filter.html b/Resources/Private/Partials/Backend/Filter.html index 3542cfd1..9b7eb664 100644 --- a/Resources/Private/Partials/Backend/Filter.html +++ b/Resources/Private/Partials/Backend/Filter.html @@ -19,7 +19,9 @@
- +
- +
- +
- +
diff --git a/Resources/Private/Partials/Backend/List.html b/Resources/Private/Partials/Backend/List.html index a4d6b42b..e8056430 100644 --- a/Resources/Private/Partials/Backend/List.html +++ b/Resources/Private/Partials/Backend/List.html @@ -5,22 +5,22 @@ - Title + Title - Date + Date - Type + Type - Language + Language - ID + ID - Action + Action @@ -33,7 +33,7 @@ {totalAmount} - items + items diff --git a/Resources/Private/Templates/Backend/List.html b/Resources/Private/Templates/Backend/List.html index 88f2a950..2684f76f 100644 --- a/Resources/Private/Templates/Backend/List.html +++ b/Resources/Private/Templates/Backend/List.html @@ -22,7 +22,7 @@

Calendarize

- {value} on {pids.{pid}} + {value} on {pids.{pid}} @@ -30,7 +30,11 @@

Calendarize

-

Note: If you create first events in Storage folder, the create buttons will appear in this location

+

+ + Note: If you create first events in Storage folder, the create buttons will appear in this location + +