2 namespace TYPO3\CMS\Lang\Domain\Repository;
85 $globalSettings = $configurationManager->getLocalConfigurationValueByPath($this->configurationPath);
86 $this->selectedLocales = (array)$globalSettings[
'availableLanguages'];
87 }
catch (\Exception $e) {
88 $configurationManager->setLocalConfigurationValueByPath(
89 $this->configurationPath,
90 array(
'availableLanguages' => array())
100 public function findAll()
102 if (empty($this->languages)) {
105 foreach (
$languages as $locale => $language) {
106 $label = htmlspecialchars(
$GLOBALS[
'LANG']->sL(
'LLL:EXT:setup/Resources/Private/Language/locallang.xlf:lang_' . $locale));
108 $label = htmlspecialchars($language);
110 $this->languages[$locale] = $this->objectManager->get(
111 \TYPO3\CMS\Lang\Domain\Model\Language::class,
114 in_array($locale, $this->selectedLocales),
115 $this->registryService->get($locale)
118 usort($this->languages,
function ($a, $b) {
121 if ($a->getLabel() == $b->getLabel()) {
124 return $a->getLabel() < $b->getLabel() ? -1 : 1;
140 if ($language->getSelected()) {
141 $result[] = $language;
156 $dependencies = array();
158 $dependencies = array_merge($dependencies, $this->locales->getLocaleDependencies($language));
160 if (!empty($dependencies)) {
163 $dir = count(
$languages) - count($this->selectedLocales);
164 $diff = $dir < 0 ? array_diff($this->selectedLocales,
$languages) : array_diff(
$languages, $this->selectedLocales);
166 $this->configurationPath,
170 'success' => !empty($diff),
172 'diff' => array_values($diff),
188 if ($language->getSelected() || $language->getLocale() === $locale) {
189 $locales[] = $language->getLocale();
206 if ($language->getSelected() && $language->getLocale() !== $locale) {
207 $locales[] = $language->getLocale();