diff --git a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php index ca689388d8fccb09621aae23c175d89917a1bfc4..9b2ee323ef3c4d2452c84d2c1c212edbcfd6a5a9 100644 --- a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php +++ b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php @@ -168,6 +168,7 @@ class PageLayoutController $configuration->setShowHidden((bool)$this->moduleData->get('showHidden')); $configuration->setLanguageColumns($this->MOD_MENU['language']); $configuration->setSelectedLanguageId($this->currentSelectedLanguage); + $configuration->setAllowInconsistentLanguageHandling((bool)($tsConfig['mod.']['web_layout.']['allowInconsistentLanguageHandling'] ?? false)); if ((int)$this->moduleData->get('function') === 2) { $configuration->setLanguageMode(true); } diff --git a/typo3/sysext/backend/Classes/View/BackendLayout/ContentFetcher.php b/typo3/sysext/backend/Classes/View/BackendLayout/ContentFetcher.php index 6cec186aa050c36872ee161663a0acbfa09857b3..1a106922b251d62576707cc6c62475019c182b07 100644 --- a/typo3/sysext/backend/Classes/View/BackendLayout/ContentFetcher.php +++ b/typo3/sysext/backend/Classes/View/BackendLayout/ContentFetcher.php @@ -188,17 +188,21 @@ class ContentFetcher && $languageTranslationInfo['hasTranslations'] ) { $languageTranslationInfo['mode'] = 'mixed'; - $siteLanguage = $this->context->getSiteLanguage($language); - $message = GeneralUtility::makeInstance( - FlashMessage::class, - $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:staleTranslationWarning'), - sprintf($this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:staleTranslationWarningTitle'), $siteLanguage->getTitle()), - ContextualFeedbackSeverity::WARNING - ); - $service = GeneralUtility::makeInstance(FlashMessageService::class); - $queue = $service->getMessageQueueByIdentifier(); - $queue->addMessage($message); + // We do not want to show the staleTranslationWarning if allowInconsistentLanguageHandling is enabled + $allowInconsistentLanguageHandling = (bool)(BackendUtility::getPagesTSconfig($this->context->getPageId())['mod.']['web_layout.']['allowInconsistentLanguageHandling'] ?? false); + if (!$this->context->getDrawingConfiguration()->getAllowInconsistentLanguageHandling()) { + $siteLanguage = $this->context->getSiteLanguage($language); + $message = GeneralUtility::makeInstance( + FlashMessage::class, + $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:staleTranslationWarning'), + sprintf($this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:staleTranslationWarningTitle'), $siteLanguage->getTitle()), + ContextualFeedbackSeverity::WARNING + ); + $service = GeneralUtility::makeInstance(FlashMessageService::class); + $queue = $service->getMessageQueueByIdentifier(); + $queue->addMessage($message); + } } $this->getRuntimeCache()->set('ContentFetcher_TranslationInfo_' . $language, $languageTranslationInfo); diff --git a/typo3/sysext/backend/Classes/View/Drawing/DrawingConfiguration.php b/typo3/sysext/backend/Classes/View/Drawing/DrawingConfiguration.php index cdf34b20710ce9fdbc4930d797311a5ca2e59825..482c6a37aacce96d73cc803605303725059a9f91 100644 --- a/typo3/sysext/backend/Classes/View/Drawing/DrawingConfiguration.php +++ b/typo3/sysext/backend/Classes/View/Drawing/DrawingConfiguration.php @@ -39,6 +39,11 @@ class DrawingConfiguration */ protected $selectedLanguageId = 0; + /** + * Corresponds to web.layout.allowInconsistentLanguageHandling TSconfig property + */ + protected bool $allowInconsistentLanguageHandling = false; + /** * Determines whether rendering should happen with a visually aligned * connection between default language and translation. When rendered @@ -90,6 +95,16 @@ class DrawingConfiguration $this->selectedLanguageId = $selectedLanguageId; } + public function getAllowInconsistentLanguageHandling(): bool + { + return $this->allowInconsistentLanguageHandling; + } + + public function setAllowInconsistentLanguageHandling(bool $allowInconsistentLanguageHandling): void + { + $this->allowInconsistentLanguageHandling = $allowInconsistentLanguageHandling; + } + public function getDefaultLanguageBinding(): bool { return $this->defaultLanguageBinding;