From 0fcd0b1131e83793f232d870a9f4c1f1f23d3f40 Mon Sep 17 00:00:00 2001 From: Ingolf Steinhardt Date: Wed, 13 Dec 2023 21:24:13 +0100 Subject: [PATCH] Fix translation button renderer --- .../AbstractListShowAllHandler.php | 8 +- .../MultipleHandler/EditAllHandler.php | 2 +- .../MultipleHandler/OverrideAllHandler.php | 6 +- .../SelectPropertyAllHandler.php | 22 +++-- .../ActionHandler/ShowHandler.php | 6 +- .../Contao2BackendView/ButtonRenderer.php | 18 ++-- .../View/Contao2BackendView/EditMask.php | 8 +- .../CreateSubHeadlineListener.php | 2 +- .../SelectModeButtonsListener.php | 11 ++- .../Subscriber/GetGroupHeaderSubscriber.php | 6 +- .../View/Contao2BackendView/TreePicker.php | 14 ++- .../View/Contao2BackendView/TreeView.php | 6 +- src/Resources/contao/languages/de/default.php | 45 --------- src/Resources/contao/languages/en/default.php | 45 --------- src/Resources/translations/default.de.xlf | 98 +++++++++++++++++++ src/Resources/translations/default.en.xlf | 98 +++++++++++++++++++ .../AbstractPropertyVisibilityHandler.php | 22 +++-- 17 files changed, 270 insertions(+), 147 deletions(-) delete mode 100644 src/Resources/contao/languages/de/default.php delete mode 100644 src/Resources/contao/languages/en/default.php create mode 100644 src/Resources/translations/default.de.xlf create mode 100644 src/Resources/translations/default.en.xlf diff --git a/src/Contao/View/Contao2BackendView/ActionHandler/AbstractListShowAllHandler.php b/src/Contao/View/Contao2BackendView/ActionHandler/AbstractListShowAllHandler.php index e97cbc46..ec86322c 100644 --- a/src/Contao/View/Contao2BackendView/ActionHandler/AbstractListShowAllHandler.php +++ b/src/Contao/View/Contao2BackendView/ActionHandler/AbstractListShowAllHandler.php @@ -3,7 +3,7 @@ /** * This file is part of contao-community-alliance/dc-general. * - * (c) 2013-2023 Contao Community Alliance. + * (c) 2013-2024 Contao Community Alliance. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -16,7 +16,7 @@ * @author David Molineus * @author Richard Henkenjohann * @author Ingolf Steinhardt - * @copyright 2013-2023 Contao Community Alliance. + * @copyright 2013-2024 Contao Community Alliance. * @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later * @filesource */ @@ -280,7 +280,7 @@ private function languageSwitcher(EnvironmentInterface $environment) return $template ->set('languages', $controller->getSupportedLanguages(null)) ->set('language', $dataProvider->getCurrentLanguage()) - ->set('submit', $this->translator->trans('MSC.showSelected', [], 'contao_default')) + ->set('submit', $this->translator->trans('MSC.showSelected', 'default')) ->set('REQUEST_TOKEN', $this->tokenManager->getToken($this->tokenName)) ->parse(); } @@ -402,7 +402,7 @@ protected function renderTemplate(ContaoBackendViewTemplate $template, Environme $showColumn = $this->getViewSection($definition)->getListingConfig()->getShowColumns(); $template - ->set('subHeadline', $this->translate('MSC.select_models', 'contao_default')) + ->set('subHeadline', $this->translate('MSC.select_models', 'default')) ->set('tableName', ($definition->getName() ?: 'none')) ->set('select', 'select' === $provider->getParameter('act')) ->set('action', StringUtil::ampersand(Environment::get('request'))) diff --git a/src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/EditAllHandler.php b/src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/EditAllHandler.php index bad69dbf..1369fe97 100644 --- a/src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/EditAllHandler.php +++ b/src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/EditAllHandler.php @@ -289,7 +289,7 @@ private function renderEditFields( $fields[] = \sprintf( '

 

%s

 

', - $translator->translate('MSC.no_properties_available') + $translator->translate('MSC.no_properties_available', 'default') ); } diff --git a/src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/OverrideAllHandler.php b/src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/OverrideAllHandler.php index ac676e98..d097c6e3 100644 --- a/src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/OverrideAllHandler.php +++ b/src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/OverrideAllHandler.php @@ -3,7 +3,7 @@ /** * This file is part of contao-community-alliance/dc-general. * - * (c) 2013-2023 Contao Community Alliance. + * (c) 2013-2024 Contao Community Alliance. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,7 @@ * @author Sven Baumann * @author Richard Henkenjohann * @author Ingolf Steinhardt - * @copyright 2013-2023 Contao Community Alliance. + * @copyright 2013-2024 Contao Community Alliance. * @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0 * @filesource */ @@ -332,7 +332,7 @@ private function renderFieldSets( if (empty($fieldSet['palette'])) { $fieldSet['palette'] = \sprintf( '

 

%s

 

', - $translator->translate('MSC.no_properties_available') + $translator->translate('MSC.no_properties_available', 'default') ); } diff --git a/src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/SelectPropertyAllHandler.php b/src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/SelectPropertyAllHandler.php index 6d10da9c..1d01bd65 100644 --- a/src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/SelectPropertyAllHandler.php +++ b/src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/SelectPropertyAllHandler.php @@ -3,7 +3,7 @@ /** * This file is part of contao-community-alliance/dc-general. * - * (c) 2013-2023 Contao Community Alliance. + * (c) 2013-2024 Contao Community Alliance. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -13,7 +13,7 @@ * @package contao-community-alliance/dc-general * @author Sven Baumann * @author Ingolf Steinhardt - * @copyright 2013-2023 Contao Community Alliance. + * @copyright 2013-2024 Contao Community Alliance. * @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0 * @filesource */ @@ -234,10 +234,16 @@ private function isPropertyAllowed(PropertyInterface $property, EnvironmentInter assert($inputProvider instanceof InputProviderInterface); Message::addInfo( - \sprintf( - $translator->translate('MSC.not_allowed_property_info'), - $property->getLabel() ?: $property->getName(), - $translator->translate('MSC.' . $inputProvider->getParameter('mode') . 'Selected') + $translator->translate( + 'MSC.not_allowed_property_info', + 'default', + [ + '%property%' => $property->getLabel() ?: $property->getName(), + '%mode%' => $translator->translate( + 'MSC.' . $inputProvider->getParameter('mode') . 'Selected', + 'default' + ) + ] ) ); @@ -392,7 +398,7 @@ protected function renderTemplate(ContaoBackendViewTemplate $template, Environme \sprintf( '%s: %s', $this->translate('MSC.' . $inputProvider->getParameter('mode') . 'Selected', $languageDomain), - $this->translate('MSC.edit_all_select_properties', $languageDomain) + $this->translate('MSC.edit_all_select_properties', 'default') ) ) ->set('mode', 'none') @@ -436,7 +442,7 @@ protected function getSelectButtons(EnvironmentInterface $environment) '
' . '' . '
', - StringUtil::specialchars($this->translate('MSC.nothingSelect', $languageDomain)), + StringUtil::specialchars($this->translate('MSC.nothingSelect', 'default')), 'tl_submit', StringUtil::specialchars($this->translate('MSC.close', $languageDomain)), 'BackendGeneral.hideMessage(); return false;' diff --git a/src/Contao/View/Contao2BackendView/ActionHandler/ShowHandler.php b/src/Contao/View/Contao2BackendView/ActionHandler/ShowHandler.php index 0eabb619..c115c1be 100644 --- a/src/Contao/View/Contao2BackendView/ActionHandler/ShowHandler.php +++ b/src/Contao/View/Contao2BackendView/ActionHandler/ShowHandler.php @@ -3,7 +3,7 @@ /** * This file is part of contao-community-alliance/dc-general. * - * (c) 2013-2023 Contao Community Alliance. + * (c) 2013-2024 Contao Community Alliance. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -16,7 +16,7 @@ * @author Sven Baumann * @author David Molineus * @author Ingolf Steinhardt - * @copyright 2013-2023 Contao Community Alliance. + * @copyright 2013-2024 Contao Community Alliance. * @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later * @filesource */ @@ -354,7 +354,7 @@ protected function process(Action $action, EnvironmentInterface $environment) $template ->set('languages', $controller->getSupportedLanguages($model->getId())) ->set('currentLanguage', $dataProvider->getCurrentLanguage()) - ->set('languageSubmit', $translator->translate('MSC.showSelected')) + ->set('languageSubmit', $translator->translate('MSC.showSelected', 'default')) ->set('backBT', StringUtil::specialchars($translator->translate('MSC.backBT'))) ->set('REQUEST_TOKEN', $this->tokenManager->getToken($this->tokenName)); } else { diff --git a/src/Contao/View/Contao2BackendView/ButtonRenderer.php b/src/Contao/View/Contao2BackendView/ButtonRenderer.php index a3650ff2..6f212496 100644 --- a/src/Contao/View/Contao2BackendView/ButtonRenderer.php +++ b/src/Contao/View/Contao2BackendView/ButtonRenderer.php @@ -69,49 +69,49 @@ class ButtonRenderer * * @var list */ - private $circularModelIds; + private array $circularModelIds; /** * The clipboard items in use. * * @var list */ - private $clipboardItems; + private array $clipboardItems; /** * The models for the clipboard items. * * @var CollectionInterface */ - private $clipboardModels; + private CollectionInterface $clipboardModels; /** * The clipboard in use. * * @var CommandCollectionInterface */ - private $commands; + private CommandCollectionInterface $commands; /** * The environment. * * @var EnvironmentInterface */ - private $environment; + private EnvironmentInterface $environment; /** * The event dispatcher. * * @var EventDispatcherInterface */ - private $eventDispatcher; + private EventDispatcherInterface $eventDispatcher; /** * The translator in use. * * @var TranslatorInterface */ - private $translator; + private TranslatorInterface $translator; /** * Create a new instance. @@ -369,8 +369,8 @@ private function buildCommand($command, $model, $previous, $next, $isCircularRef 'title="%s" class="%s"', StringUtil::specialchars($this->translator->translate( 'MSC.dc_general_disabled', - 'contao_default', - [$buttonEvent->getTitle()] + 'default', + ['%title%' => $buttonEvent->getTitle()] )), 'cursor_disabled' ) diff --git a/src/Contao/View/Contao2BackendView/EditMask.php b/src/Contao/View/Contao2BackendView/EditMask.php index f409436c..17d1e3ff 100644 --- a/src/Contao/View/Contao2BackendView/EditMask.php +++ b/src/Contao/View/Contao2BackendView/EditMask.php @@ -3,7 +3,7 @@ /** * This file is part of contao-community-alliance/dc-general. * - * (c) 2013-2023 Contao Community Alliance. + * (c) 2013-2024 Contao Community Alliance. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -18,7 +18,7 @@ * @author Stefan Heimes * @author Sven Baumann * @author Richard Henkenjohann - * @copyright 2013-2023 Contao Community Alliance. + * @copyright 2013-2024 Contao Community Alliance. * @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later * @filesource */ @@ -884,7 +884,7 @@ protected function allValuesUnique() if (!$dataProvider->isUniqueValue($propertyName, $value, $this->model->getId())) { $editInformation->setModelError( $this->model, - [$translator->translate('MSC.not_unique', null, [$propertyName])], + [$translator->translate('MSC.not_unique', 'default', ['%property%' => $propertyName])], $definition ); @@ -1039,7 +1039,7 @@ private function executeMultiLanguage(ContaoBackendViewTemplate $template) $template ->set('languages', $controller->getSupportedLanguages($this->model->getId())) ->set('language', $dataProvider->getCurrentLanguage()) - ->set('languageSubmit', $translator->translate('MSC.showSelected')) + ->set('languageSubmit', $translator->translate('MSC.showSelected', 'default')) ->set('languageHeadline', $languages[$dataProvider->getCurrentLanguage()] ?? ''); return; diff --git a/src/Contao/View/Contao2BackendView/EventListener/CreateSubHeadlineListener.php b/src/Contao/View/Contao2BackendView/EventListener/CreateSubHeadlineListener.php index 6665c7d1..d1dfbb30 100644 --- a/src/Contao/View/Contao2BackendView/EventListener/CreateSubHeadlineListener.php +++ b/src/Contao/View/Contao2BackendView/EventListener/CreateSubHeadlineListener.php @@ -70,7 +70,7 @@ private function createSubHeadline(string $status, GetEditMaskSubHeadlineEvent $ if ($status !== $headline) { $subHeadline = $headline; } else { - $subHeadline = $translator->translate('MSC.' . $status, null, [$event->getModel()->getId()]); + $subHeadline = $translator->translate('MSC.' . $status, 'default', [$event->getModel()->getId()]); } $event->setHeadline($subHeadline); diff --git a/src/Contao/View/Contao2BackendView/EventListener/SelectModeButtonsListener.php b/src/Contao/View/Contao2BackendView/EventListener/SelectModeButtonsListener.php index f143c04c..3d8cab79 100644 --- a/src/Contao/View/Contao2BackendView/EventListener/SelectModeButtonsListener.php +++ b/src/Contao/View/Contao2BackendView/EventListener/SelectModeButtonsListener.php @@ -3,7 +3,7 @@ /** * This file is part of contao-community-alliance/dc-general. * - * (c) 2013-2023 Contao Community Alliance. + * (c) 2013-2024 Contao Community Alliance. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -12,7 +12,8 @@ * * @package contao-community-alliance/dc-general * @author Sven Baumann - * @copyright 2013-2023 Contao Community Alliance. + * @author Ingolf Steinhardt + * @copyright 2013-2024 Contao Community Alliance. * @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later * @filesource */ @@ -57,7 +58,7 @@ public function handleEvent(GetSelectModeButtonsEvent $event) '
' . '' . '
', - StringUtil::specialchars($translator->translate('MSC.nothingSelect', 'contao_default')), + StringUtil::specialchars($translator->translate('MSC.nothingSelect', 'default')), 'tl_submit', StringUtil::specialchars($translator->translate('MSC.close', 'contao_default')), 'this.blur(); BackendGeneral.hideMessage(); return false;' @@ -74,8 +75,8 @@ public function handleEvent(GetSelectModeButtonsEvent $event) 'models[]', $confirmMessage, StringUtil::specialchars($translator->translate('MSC.delAllConfirm', 'contao_default')), - StringUtil::specialchars($translator->translate('MSC.confirmOk', 'contao_default')), - StringUtil::specialchars($translator->translate('MSC.confirmAbort', 'contao_default')) + StringUtil::specialchars($translator->translate('MSC.confirmOk', 'default')), + StringUtil::specialchars($translator->translate('MSC.confirmAbort', 'default')) ); $buttons['delete'] = \sprintf( diff --git a/src/Contao/View/Contao2BackendView/Subscriber/GetGroupHeaderSubscriber.php b/src/Contao/View/Contao2BackendView/Subscriber/GetGroupHeaderSubscriber.php index af9edb7b..4b372869 100644 --- a/src/Contao/View/Contao2BackendView/Subscriber/GetGroupHeaderSubscriber.php +++ b/src/Contao/View/Contao2BackendView/Subscriber/GetGroupHeaderSubscriber.php @@ -3,7 +3,7 @@ /** * This file is part of contao-community-alliance/dc-general. * - * (c) 2013-2023 Contao Community Alliance. + * (c) 2013-2024 Contao Community Alliance. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,7 +17,7 @@ * @author Sven Baumann * @author Ingolf Steinhardt * @author Cliff Parnitzky - * @copyright 2013-2023 Contao Community Alliance. + * @copyright 2013-2024 Contao Community Alliance. * @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later * @filesource */ @@ -272,7 +272,7 @@ private function formatByWeekGrouping(int $value): string return '-'; } - $event = new ParseDateEvent($value, $this->translator->translate('MSC.week_format')); + $event = new ParseDateEvent($value, $this->translator->translate('MSC.week_format', 'default')); $this->dispatcher->dispatch($event, ContaoEvents::DATE_PARSE); return $event->getResult(); diff --git a/src/Contao/View/Contao2BackendView/TreePicker.php b/src/Contao/View/Contao2BackendView/TreePicker.php index 22734d38..7c875f61 100644 --- a/src/Contao/View/Contao2BackendView/TreePicker.php +++ b/src/Contao/View/Contao2BackendView/TreePicker.php @@ -3,7 +3,7 @@ /** * This file is part of contao-community-alliance/dc-general. * - * (c) 2013-2023 Contao Community Alliance. + * (c) 2013-2024 Contao Community Alliance. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -19,7 +19,7 @@ * @author Ingolf Steinhardt * @author David Molineus * @author Kim Wormer - * @copyright 2013-2023 Contao Community Alliance. + * @copyright 2013-2024 Contao Community Alliance. * @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later * @filesource */ @@ -645,7 +645,10 @@ public function generate() /** @psalm-suppress PropertyNotSetInConstructor */ ->set('class', ($this->strClass ? ' ' . $this->strClass : '')) ->set('icon', $icon->getHtml()) - ->set('title', $translator->translate($this->title ?: 'MSC.treePicker', null, [$this->sourceName])) + ->set( + 'title', + $translator->translate($this->title ?: 'MSC.treePicker', 'default', ['%table%' => $this->sourceName]) + ) ->set('changeSelection', $translator->translate('MSC.changeSelection')) ->set('dragItemsHint', $translator->translate('MSC.dragItemsHint')) ->set('fieldType', $this->fieldType) @@ -909,7 +912,10 @@ public function generatePopup() /** @psalm-suppress PropertyNotSetInConstructor */ ->set('class', ($this->strClass ? ' ' . $this->strClass : '')) ->set('icon', $icon->getHtml()) - ->set('title', $translator->translate($this->title ?: 'MSC.treePicker', null, [$this->sourceName])) + ->set( + 'title', + $translator->translate($this->title ?: 'MSC.treePicker', 'default', ['%table%' => $this->sourceName]) + ) ->set('fieldType', $this->fieldType) ->set('resetSelected', $translator->translate('MSC.resetSelected')) ->set('selectAll', $translator->translate('MSC.selectAll')) diff --git a/src/Contao/View/Contao2BackendView/TreeView.php b/src/Contao/View/Contao2BackendView/TreeView.php index 5895b4fe..96238f24 100644 --- a/src/Contao/View/Contao2BackendView/TreeView.php +++ b/src/Contao/View/Contao2BackendView/TreeView.php @@ -3,7 +3,7 @@ /** * This file is part of contao-community-alliance/dc-general. * - * (c) 2013-2023 Contao Community Alliance. + * (c) 2013-2024 Contao Community Alliance. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,7 +17,7 @@ * @author David Molineus * @author Ingolf Steinhardt * @author Sven Baumann - * @copyright 2013-2023 Contao Community Alliance. + * @copyright 2013-2024 Contao Community Alliance. * @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later * @filesource */ @@ -763,7 +763,7 @@ private function languageSwitcher(EnvironmentInterface $environment) return $template ->set('languages', $controller->getSupportedLanguages(null)) ->set('language', $dataProvider->getCurrentLanguage()) - ->set('submit', $translator->translate('MSC.showSelected')) + ->set('submit', $translator->translate('MSC.showSelected', 'default')) ->set('REQUEST_TOKEN', $this->tokenManager->getToken($this->tokenName)) ->parse(); } diff --git a/src/Resources/contao/languages/de/default.php b/src/Resources/contao/languages/de/default.php deleted file mode 100644 index 97f57809..00000000 --- a/src/Resources/contao/languages/de/default.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @author Stefan Heimes - * @author Tristan Lins - * @author Sven Baumann - * @author Ingolf Steinhardt - * @author David Molineus - * @author Cliff Parnitzky - * @copyright 2013-2023 Contao Community Alliance. - * @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later - * @filesource - */ - -// @codingStandardsIgnoreStart -$GLOBALS['TL_LANG']['MSC']['language'] = 'Sprache'; -$GLOBALS['TL_LANG']['MSC']['showSelected'] = 'Sprache wechseln'; -$GLOBALS['TL_LANG']['MSC']['treePicker'] = 'Tabelle: %s'; -$GLOBALS['TL_LANG']['MSC']['not_unique'] = 'Die Eigenschaft "%s" ist schon in der Datenbank und nicht unique.'; -$GLOBALS['TL_LANG']['MSC']['nothingSelect'] = 'Es wurde nichts ausgewählt!'; -$GLOBALS['TL_LANG']['MSC']['confirmOk'] = 'Ok'; -$GLOBALS['TL_LANG']['MSC']['confirmAbort'] = 'Abbrechen'; -$GLOBALS['TL_LANG']['MSC']['closeAll'] = ['Beenden', 'Die Mehrfachbearbeitung beenden.']; -$GLOBALS['TL_LANG']['MSC']['property_select_unique'] = '%s ist eine eindeutige Eigenschaft. Diese Eigenschaft wird bei %s nicht unterstützt.'; -$GLOBALS['TL_LANG']['MSC']['not_allowed_property_info'] = 'Die Eigenschaft "%s" wird im Modus %s nicht untersützt.'; -$GLOBALS['TL_LANG']['MSC']['select_property_info'] = 'Die Eigenschaft "%s" muss ausgewählt sein, damit diese bearbeitet werden kann.'; -$GLOBALS['TL_LANG']['MSC']['select_parent_property_info'] = 'Die Abhängige Eigenschaft "%s" muss ausgewählt sein, damit man die Eigenschaft "%s" bearbeiten kann.'; -$GLOBALS['TL_LANG']['MSC']['edit_all_select_properties'] = 'Eigenschaften auswählen'; -$GLOBALS['TL_LANG']['MSC']['no_properties_available'] = 'Bitte überprüfen Sie die ausgewählten Eigenschaften!'; -$GLOBALS['TL_LANG']['MSC']['select_models'] = 'Elemente auswählen'; -$GLOBALS['TL_LANG']['MSC']['dc_general_disabled'] = 'Gesperrt: %s'; -$GLOBALS['TL_LANG']['MSC']['newRecord'] = 'Neuen Datensatz erstellen'; -$GLOBALS['TL_LANG']['MSC']['week_format'] = 'W. Y'; -// @codingStandardsIgnoreEnd diff --git a/src/Resources/contao/languages/en/default.php b/src/Resources/contao/languages/en/default.php deleted file mode 100644 index defc1134..00000000 --- a/src/Resources/contao/languages/en/default.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @author Stefan Heimes - * @author Tristan Lins - * @author Sven Baumann - * @author Ingolf Steinhardt - * @author David Molineus - * @author Cliff Parnitzky - * @copyright 2013-2023 Contao Community Alliance. - * @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later - * @filesource - */ - -// @codingStandardsIgnoreStart -$GLOBALS['TL_LANG']['MSC']['language'] = 'Language'; -$GLOBALS['TL_LANG']['MSC']['showSelected'] = 'Switch language'; -$GLOBALS['TL_LANG']['MSC']['treePicker'] = 'Table: %s'; -$GLOBALS['TL_LANG']['MSC']['not_unique'] = 'The property "%s" is already in the database and not unique.'; -$GLOBALS['TL_LANG']['MSC']['nothingSelect'] = 'Nothing was selected!'; -$GLOBALS['TL_LANG']['MSC']['confirmOk'] = 'Ok'; -$GLOBALS['TL_LANG']['MSC']['confirmAbort'] = 'Abort'; -$GLOBALS['TL_LANG']['MSC']['closeAll'] = ['Cancel', 'Cancel multiple processing.']; -$GLOBALS['TL_LANG']['MSC']['property_select_unique'] = '%s is a unique property. This property is not supported at %s.'; -$GLOBALS['TL_LANG']['MSC']['not_allowed_property_info'] = 'The property "%s" isn´t allow to use at %s.'; -$GLOBALS['TL_LANG']['MSC']['select_property_info'] = 'You must select the property "%s" for edit it.'; -$GLOBALS['TL_LANG']['MSC']['select_parent_property_info'] = 'You must select the parent property "%s" for edit the property "%s".'; -$GLOBALS['TL_LANG']['MSC']['edit_all_select_properties'] = 'Select properties'; -$GLOBALS['TL_LANG']['MSC']['no_properties_available'] = 'Please check your selected properties!'; -$GLOBALS['TL_LANG']['MSC']['select_models'] = 'Select models'; -$GLOBALS['TL_LANG']['MSC']['dc_general_disabled'] = 'Disabled: %s'; -$GLOBALS['TL_LANG']['MSC']['newRecord'] = 'Create a new item'; -$GLOBALS['TL_LANG']['MSC']['week_format'] = 'W Y'; -// @codingStandardsIgnoreEnd diff --git a/src/Resources/translations/default.de.xlf b/src/Resources/translations/default.de.xlf new file mode 100644 index 00000000..f58c2b37 --- /dev/null +++ b/src/Resources/translations/default.de.xlf @@ -0,0 +1,98 @@ + + + + + + Sprache + + + + + Sprache wechseln + + + + + Tabelle: %table% + + + + + Die Eigenschaft "%property%" ist schon in der Datenbank und nicht unique. + + + + + Es wurde nichts ausgewählt! + + + + + Ok + + + + + Abbrechen + + + + + Beenden + + + Die Mehrfachbearbeitung beenden. + + + + + "%property%" ist eine eindeutige Eigenschaft. Diese Eigenschaft wird bei "%mode%" nicht unterstützt. + + + + + Die Eigenschaft "%property%" wird im Modus "%mode%" nicht unterstützt. + + + + + Die Eigenschaft "%property%" muss ausgewählt sein, damit diese bearbeitet werden kann. + + + + + Die Abhängige Eigenschaft "%parent_property%" muss ausgewählt sein, damit man die Eigenschaft "%edit_property%" bearbeiten kann. + + + + + Eigenschaften auswählen + + + + + Bitte überprüfen Sie die ausgewählten Eigenschaften! + + + + + Elemente auswählen + + + + + Gesperrt: %title% + + + + + Neuen Datensatz erstellen + + + + + W. Y + + + + diff --git a/src/Resources/translations/default.en.xlf b/src/Resources/translations/default.en.xlf new file mode 100644 index 00000000..d51198f5 --- /dev/null +++ b/src/Resources/translations/default.en.xlf @@ -0,0 +1,98 @@ + + + + + + Language + + + + + Switch language + + + + + Table: %table% + + + + + The property "%property%" is already in the database and not unique. + + + + + Nothing was selected! + + + + + Ok + + + + + Abort + + + + + Cancel + + + Cancel multiple processing. + + + + + ""%property%"" is a unique property. This property is not supported at mode ""%mode%"". + + + + + The property "%property%" isn´t allow to use at mode "%mode%". + + + + + You must select the property "%property%" for edit it. + + + + + You must select the parent property "%parent_property%" for edit the property "%edit_property%". + + + + + Select properties + + + + + Please check your selected properties! + + + + + Select models + + + + + Disabled: %title% + + + + + Create a new item + + + + + W Y + + + + diff --git a/src/View/ActionHandler/AbstractPropertyVisibilityHandler.php b/src/View/ActionHandler/AbstractPropertyVisibilityHandler.php index 71fdd757..c48030fa 100644 --- a/src/View/ActionHandler/AbstractPropertyVisibilityHandler.php +++ b/src/View/ActionHandler/AbstractPropertyVisibilityHandler.php @@ -3,7 +3,7 @@ /** * This file is part of contao-community-alliance/dc-general. * - * (c) 2013-2021 Contao Community Alliance. + * (c) 2013-2024 Contao Community Alliance. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -12,7 +12,8 @@ * * @package contao-community-alliance/dc-general * @author Sven Baumann - * @copyright 2013-2021 Contao Community Alliance. + * @author Ingolf Steinhardt + * @copyright 2013-2024 Contao Community Alliance. * @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0 * @filesource */ @@ -21,9 +22,6 @@ use ContaoCommunityAlliance\DcGeneral\Action; use ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\GetPropertyOptionsEvent; -use ContaoCommunityAlliance\DcGeneral\Data\ModelId; -use ContaoCommunityAlliance\DcGeneral\Data\ModelInterface; -use ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBagInterface; use ContaoCommunityAlliance\DcGeneral\DataDefinition; use ContaoCommunityAlliance\DcGeneral\DataDefinition\ConditionChainInterface; use ContaoCommunityAlliance\DcGeneral\DataDefinition\ConditionInterface; @@ -33,6 +31,9 @@ use ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface; use ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Property\PropertyTrueCondition; use ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface; +use ContaoCommunityAlliance\DcGeneral\Data\ModelId; +use ContaoCommunityAlliance\DcGeneral\Data\ModelInterface; +use ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBagInterface; use ContaoCommunityAlliance\DcGeneral\EnvironmentInterface; use ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralInvalidArgumentException; use ContaoCommunityAlliance\DcGeneral\InputProviderInterface; @@ -458,9 +459,12 @@ protected function injectSelectParentPropertyInformation( $labelEditProperty = !$property->getLabel() ? $property->getName() : $property->getLabel(); $information[] = sprintf( - '

' . $translator->translate('MSC.select_parent_property_info') . '

', - $labelParentProperty, - $labelEditProperty + '

%s

', + $translator->translate( + 'MSC.select_parent_property_info', + 'default', + ['%parent_property%' => $labelParentProperty, '%edit_property%' => $labelEditProperty] + ) ); } @@ -497,7 +501,7 @@ protected function injectSelectSubPropertiesInformation( $label = !$informationProperty->getLabel() ? $propertyName : $informationProperty->getLabel(); $information[] = sprintf( - '

' . $translator->translate('MSC.select_property_info') . '

', + '

' . $translator->translate('MSC.select_property_info', 'default') . '

', $label ); }