getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site.languages.new') . ']'; return; } $primaryValue = $record['primary'] ?? null; $isPrimary = false; if (is_array($primaryValue)) { $isPrimary = !empty($primaryValue[0]); } elseif ($primaryValue !== null) { $isPrimary = (bool)$primaryValue; } if (!$isPrimary) { $isPrimary = ((int)($record['languageId'][0] ?? -1) === 0); } $parameters['title'] = sprintf( '%s %s [%d] (%s) Base: %s%s', $record['enabled'] ? '' : '[' . $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:disabled') . ']', $record['title'], $languageId, $record['locale'], $record['base'], $isPrimary ? ' ★' : '' ); } /** * Used to build the IRRE title of a site route element */ public function getRouteTitle(array &$parameters): void { $record = $parameters['row']; if (($record['type'][0] ?? false) === 'uri') { $parameters['title'] = sprintf( '%s %s %s', $record['route'], $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site.routes.irreHeader.redirectsTo'), $record['source'] ?: '[' . $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:undefined') . ']' ); } else { $parameters['title'] = $record['route']; } } /** * Used to build the IRRE title of a site error handling element */ public function getErrorHandlingTitle(array &$parameters): void { $record = $parameters['row']; $format = '%s: %s'; $arguments = [$record['errorCode']]; switch ($record['errorHandler'][0] ?? false) { case 'Fluid': $arguments[] = $record['errorFluidTemplate']; break; case 'Page': $arguments[] = $record['errorContentSource']; break; case 'PHP': $arguments[] = $record['errorPhpClassFQCN']; break; default: $arguments[] = $record['errorHandler'][0] ?? ''; } $parameters['title'] = sprintf($format, ...$arguments); } public static function getAllSystemLocales(): array { $locales = []; foreach (Locales::getAllSystemLocales() as $locale) { $locales[] = ['label' => $locale, 'value' => $locale]; } return $locales; } protected function getLanguageService(): LanguageService { return $GLOBALS['LANG']; } }