-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
1,127 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <[email protected]> | ||
* @author Richard Henkenjohann <[email protected]> | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @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 | ||
*/ | ||
|
@@ -76,8 +76,8 @@ | |
|
||
use function array_key_exists; | ||
use function implode; | ||
use function str_contains; | ||
use function str_replace; | ||
use function strpos; | ||
use function trigger_error; | ||
|
||
/** | ||
|
@@ -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('change-language', [], 'dc-general')) | ||
->set('REQUEST_TOKEN', $this->tokenManager->getToken($this->tokenName)) | ||
->parse(); | ||
} | ||
|
@@ -323,20 +323,21 @@ protected function translate($key, $domain, array $parameters = []) | |
$translated = $this->translator->trans($key, $parameters, $domain); | ||
|
||
// Fallback translate for non symfony domain. | ||
if ($translated === $key) { | ||
if (null !== $domain && $translated === $key && !str_starts_with($domain, 'contao_')) { | ||
// @codingStandardsIgnoreStart | ||
@trigger_error( | ||
'Fallback translation for contao lang in the global array. ' . | ||
'This will remove in the future, use the symfony domain translation.', | ||
'Fallback translation for contao lang in the global array for key "' . $key . | ||
'" in domain "' . $domain . '". ' . | ||
'This will get removed in the future, use the symfony domain translation.', | ||
E_USER_DEPRECATED | ||
); | ||
// @codingStandardsIgnoreEnd | ||
|
||
$translated = | ||
$this->translator->trans( | ||
\sprintf('%s.%s', $domain ?? '', $key), | ||
\sprintf('%s.%s', $domain, $key), | ||
$parameters, | ||
\sprintf('contao_%s', $domain ?? '') | ||
\sprintf('contao_%s', $domain) | ||
); | ||
} | ||
|
||
|
@@ -402,7 +403,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->translator->trans('select_models', [], 'dc-general')) | ||
->set('tableName', ($definition->getName() ?: 'none')) | ||
->set('select', 'select' === $provider->getParameter('act')) | ||
->set('action', StringUtil::ampersand(Environment::get('request'))) | ||
|
@@ -419,7 +420,7 @@ protected function renderTemplate(ContaoBackendViewTemplate $template, Environme | |
|
||
if ( | ||
(null !== $template->get('action')) | ||
&& (false !== strpos($template->get('action'), 'select=models')) | ||
&& (str_contains($template->get('action'), 'select=models')) | ||
) { | ||
$template->set('action', str_replace('select=models', 'select=properties', $template->get('action'))); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <[email protected]> | ||
* @author Richard Henkenjohann <[email protected]> | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @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 | ||
*/ | ||
|
@@ -131,8 +131,8 @@ private function process(Action $action, EnvironmentInterface $environment) | |
$action, | ||
[ | ||
'subHeadline' => | ||
$translator->translate('MSC.' . $inputProvider->getParameter('mode') . 'Selected') . ': ' . | ||
$translator->translate('MSC.all.0'), | ||
$translator->translate($inputProvider->getParameter('mode') . 'Selected', 'dc-general') . ': ' . | ||
$translator->translate('all_label', 'dc-general'), | ||
'fieldsets' => $renderInformation->offsetGet('fieldsets'), | ||
'table' => $definition->getName(), | ||
'error' => $renderInformation->offsetGet('error'), | ||
|
@@ -332,7 +332,7 @@ private function renderFieldSets( | |
if (empty($fieldSet['palette'])) { | ||
$fieldSet['palette'] = \sprintf( | ||
'<p> </p><strong>%s</strong><p> </p>', | ||
$translator->translate('MSC.no_properties_available') | ||
$translator->translate('no_properties_available', 'dc-general') | ||
); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <[email protected]> | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @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( | ||
'not_allowed_property_info', | ||
'dc-general', | ||
[ | ||
'%property%' => $property->getLabel() ?: $property->getName(), | ||
'%mode%' => $translator->translate( | ||
$inputProvider->getParameter('mode') . 'Selected', | ||
'dc-general' | ||
) | ||
] | ||
) | ||
); | ||
|
||
|
@@ -380,8 +386,6 @@ protected function renderTemplate(ContaoBackendViewTemplate $template, Environme | |
$dataDefinition = $environment->getDataDefinition(); | ||
assert($dataDefinition instanceof ContainerInterface); | ||
|
||
$languageDomain = 'contao_' . $dataDefinition->getName(); | ||
|
||
$this->getViewSection($dataDefinition)->getListingConfig()->setShowColumns(false); | ||
|
||
parent::renderTemplate($template, $environment); | ||
|
@@ -391,8 +395,8 @@ protected function renderTemplate(ContaoBackendViewTemplate $template, Environme | |
'subHeadline', | ||
\sprintf( | ||
'%s: %s', | ||
$this->translate('MSC.' . $inputProvider->getParameter('mode') . 'Selected', $languageDomain), | ||
$this->translate('MSC.edit_all_select_properties', $languageDomain) | ||
$this->translate($inputProvider->getParameter('mode') . 'Selected', 'dc-general'), | ||
$this->translate('edit_all_select_properties', 'dc-general') | ||
) | ||
) | ||
->set('mode', 'none') | ||
|
@@ -427,18 +431,16 @@ protected function getSelectButtons(EnvironmentInterface $environment) | |
$definition = $environment->getDataDefinition(); | ||
assert($definition instanceof ContainerInterface); | ||
|
||
$languageDomain = 'contao_' . $definition->getName(); | ||
|
||
$confirmMessage = \htmlentities( | ||
\sprintf( | ||
'<h2 class="tl_error">%s</h2>' . | ||
'<p></p>' . | ||
'<div class="tl_submit_container">' . | ||
'<input class="%s" value="%s" onclick="%s">' . | ||
'</div>', | ||
StringUtil::specialchars($this->translate('MSC.nothingSelect', $languageDomain)), | ||
StringUtil::specialchars($this->translate('nothingSelect', 'dc-general')), | ||
'tl_submit', | ||
StringUtil::specialchars($this->translate('MSC.close', $languageDomain)), | ||
StringUtil::specialchars($this->translate('close', 'dc-general')), | ||
'BackendGeneral.hideMessage(); return false;' | ||
) | ||
); | ||
|
@@ -457,7 +459,7 @@ protected function getSelectButtons(EnvironmentInterface $environment) | |
$continueName, | ||
$continueName, | ||
'c', | ||
StringUtil::specialchars($this->translate('MSC.continue', $languageDomain)), | ||
StringUtil::specialchars($this->translate('continue', 'dc-general')), | ||
$onClick | ||
) | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <[email protected]> | ||
* @author David Molineus <[email protected]> | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @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 | ||
*/ | ||
|
@@ -208,9 +208,9 @@ protected function getPropertyLabel(EnvironmentInterface $environment, PropertyI | |
return $label; | ||
} | ||
|
||
$mscKey = 'MSC.' . $property->getName() . '.0'; | ||
$label = $translator->translate($mscKey); | ||
if ($label !== $mscKey) { | ||
$translationKey = $property->getName() . '_label'; | ||
$label = $translator->translate($translationKey, 'dc-general'); | ||
if ($label !== $translationKey) { | ||
return $label; | ||
} | ||
|
||
|
@@ -292,19 +292,19 @@ protected function convertModel(ModelInterface $model, EnvironmentInterface $env | |
protected function getHeadline(TranslatorInterface $translator, $model) | ||
{ | ||
$headline = $translator->translate( | ||
'MSC.showRecord', | ||
'showRecord', | ||
$model->getProviderName(), | ||
['ID ' . $model->getId()] | ||
['%id%' => 'ID ' . $model->getId()] | ||
); | ||
|
||
if ('MSC.showRecord' !== $headline) { | ||
if ('showRecord' !== $headline) { | ||
return $headline; | ||
} | ||
|
||
return $translator->translate( | ||
'MSC.showRecord', | ||
null, | ||
['ID ' . $model->getId()] | ||
'showRecord', | ||
'dc-general', | ||
['%id%' => 'ID ' . $model->getId()] | ||
); | ||
} | ||
|
||
|
@@ -354,8 +354,8 @@ 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('backBT', StringUtil::specialchars($translator->translate('MSC.backBT'))) | ||
->set('languageSubmit', $translator->translate('change-language', 'dc-general')) | ||
->set('backBT', StringUtil::specialchars($translator->translate('backBT', 'dc-general'))) | ||
->set('REQUEST_TOKEN', $this->tokenManager->getToken($this->tokenName)); | ||
} else { | ||
$template->set('languages', null); | ||
|
Oops, something went wrong.