‪TYPO3CMS  9.5
TranslationService.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
18 use Psr\Http\Message\ServerRequestInterface;
33 
43 {
44 
50  protected ‪$LOCAL_LANG = [];
51 
60  protected ‪$LOCAL_LANG_UNSET = [];
61 
67  protected ‪$languageKey;
68 
75 
79  protected ‪$configurationManager;
80 
87  public static function ‪getInstance()
88  {
89  return GeneralUtility::makeInstance(ObjectManager::class)->get(self::class);
90  }
91 
103  public function ‪translate(
104  $key,
105  array $arguments = null,
106  string $locallangPathAndFilename = null,
107  string $language = null,
108  $defaultValue = ''
109  ) {
110  $value = null;
111  $key = (string)$key;
112 
113  if ($locallangPathAndFilename) {
114  $key = $locallangPathAndFilename . ':' . $key;
115  }
116 
117  $keyParts = explode(':', $key);
118  if (GeneralUtility::isFirstPartOfStr($key, 'LLL:')) {
119  $locallangPathAndFilename = $keyParts[1] . ':' . $keyParts[2];
120  $key = $keyParts[3];
121  } elseif (GeneralUtility::isFirstPartOfStr($key, 'EXT:')) {
122  $locallangPathAndFilename = $keyParts[0] . ':' . $keyParts[1];
123  $key = $keyParts[2];
124  } else {
125  if (count($keyParts) === 2) {
126  $locallangPathAndFilename = $keyParts[0];
127  $key = $keyParts[1];
128  }
129  }
130 
131  if ($language) {
132  $this->languageKey = $language;
133  }
134 
135  $this->‪initializeLocalization($locallangPathAndFilename ?? '');
136 
137  // The "from" charset of csConv() is only set for strings from TypoScript via _LOCAL_LANG
138  if (!empty($this->LOCAL_LANG[$this->languageKey][$key][0]['target'])
139  || isset($this->LOCAL_LANG_UNSET[$this->languageKey][$key])
140  ) {
141  // Local language translation for key exists
142  $value = $this->LOCAL_LANG[‪$this->languageKey][$key][0]['target'];
143  } elseif (!empty($this->alternativeLanguageKeys)) {
144  $languages = array_reverse($this->alternativeLanguageKeys);
145  foreach ($languages as $language) {
146  if (!empty($this->LOCAL_LANG[$language][$key][0]['target'])
147  || isset($this->LOCAL_LANG_UNSET[$language][$key])
148  ) {
149  // Alternative language translation for key exists
150  $value = $this->LOCAL_LANG[$language][$key][0]['target'];
151  break;
152  }
153  }
154  }
155 
156  if ($value === null && (!empty($this->LOCAL_LANG['default'][$key][0]['target'])
157  || isset($this->LOCAL_LANG_UNSET['default'][$key]))
158  ) {
159  // Default language translation for key exists
160  // No charset conversion because default is English and thereby ASCII
161  $value = $this->LOCAL_LANG['default'][$key][0]['target'];
162  }
163 
164  if (is_array($arguments) && !empty($arguments) && $value !== null) {
165  $value = vsprintf($value, $arguments);
166  } else {
167  if (empty($value)) {
168  $value = $defaultValue;
169  }
170  }
171 
172  return $value;
173  }
174 
183  public function ‪translateValuesRecursive(array $array, $translationFile = null): array
184  {
185  $result = $array;
186  foreach ($result as $key => $value) {
187  if (is_array($value)) {
188  $result[$key] = $this->‪translateValuesRecursive($value, $translationFile);
189  } else {
190  $translationFiles = null;
191  if (is_string($translationFile)) {
192  $translationFiles = [$translationFile];
193  } elseif (is_array($translationFile)) {
194  $translationFiles = $this->‪sortArrayWithIntegerKeysDescending($translationFile);
195  }
196 
197  if ($translationFiles) {
198  foreach ($translationFiles as $_translationFile) {
199  $translatedValue = $this->‪translate($value, null, $_translationFile, null);
200  if (!empty($translatedValue)) {
201  $result[$key] = $translatedValue;
202  break;
203  }
204  }
205  } else {
206  $result[$key] = $this->‪translate($value, null, null, null, $value);
207  }
208  }
209  }
210  return $result;
211  }
212 
220  public function ‪translateToAllBackendLanguages(
221  string $key,
222  array $arguments = null,
223  array $translationFiles = []
224  ): array {
225  $result = [];
226  $translationFiles = $this->‪sortArrayWithIntegerKeysDescending($translationFiles);
227 
228  foreach ($this->‪getAllTypo3BackendLanguages() as $language) {
229  $result[$language] = $key;
230  foreach ($translationFiles as $translationFile) {
231  $translatedValue = $this->‪translate($key, $arguments, $translationFile, $language, $key);
232  if ($translatedValue !== $key) {
233  $result[$language] = $translatedValue;
234  break;
235  }
236  }
237  }
238 
239  return $result;
240  }
241 
251  public function ‪translateFinisherOption(
252  FormRuntime $formRuntime,
253  string $finisherIdentifier,
254  string $optionKey,
255  string $optionValue,
256  array $renderingOptions = []
257  ): string {
258  if (empty($finisherIdentifier)) {
259  throw new \InvalidArgumentException('The argument "finisherIdentifier" is empty', 1476216059);
260  }
261  if (empty($optionKey)) {
262  throw new \InvalidArgumentException('The argument "optionKey" is empty', 1476216060);
263  }
264 
265  $finisherIdentifier = preg_replace('/Finisher$/', '', $finisherIdentifier);
266  $translationFile = $renderingOptions['translationFile'] ?? null;
267  if (empty($translationFile)) {
268  $translationFile = $formRuntime->getRenderingOptions()['translation']['translationFile'];
269  }
270 
271  if (is_string($translationFile)) {
272  $translationFiles = [$translationFile];
273  } else {
274  $translationFiles = $this->‪sortArrayWithIntegerKeysDescending($translationFile);
275  }
276 
277  if (isset($renderingOptions['translatePropertyValueIfEmpty'])) {
278  $translatePropertyValueIfEmpty = (bool)$renderingOptions['translatePropertyValueIfEmpty'];
279  } else {
280  $translatePropertyValueIfEmpty = true;
281  }
282 
283  if (empty($optionValue) && !$translatePropertyValueIfEmpty) {
284  return $optionValue;
285  }
286 
287  $language = null;
288  if (isset($renderingOptions['language'])) {
289  $language = $renderingOptions['language'];
290  }
291 
292  try {
293  $arguments = ‪ArrayUtility::getValueByPath($renderingOptions['arguments'] ?? [], $optionKey, '.');
294  } catch (MissingArrayPathException $e) {
295  $arguments = [];
296  }
297 
298  $originalFormIdentifier = null;
299  if (isset($formRuntime->getRenderingOptions()['_originalIdentifier'])) {
300  $originalFormIdentifier = $formRuntime->getRenderingOptions()['_originalIdentifier'];
301  }
302 
303  $translationKeyChain = [];
304  foreach ($translationFiles as $translationFile) {
305  if (!empty($originalFormIdentifier)) {
306  $translationKeyChain[] = sprintf('%s:%s.finisher.%s.%s', $translationFile, $originalFormIdentifier, $finisherIdentifier, $optionKey);
307  }
308  $translationKeyChain[] = sprintf('%s:%s.finisher.%s.%s', $translationFile, $formRuntime->getIdentifier(), $finisherIdentifier, $optionKey);
309  $translationKeyChain[] = sprintf('%s:finisher.%s.%s', $translationFile, $finisherIdentifier, $optionKey);
310  }
311 
312  $translatedValue = $this->‪processTranslationChain($translationKeyChain, $language, $arguments);
313  $translatedValue = empty($translatedValue) ? $optionValue : $translatedValue;
314 
315  return $translatedValue;
316  }
317 
326  public function ‪translateFormElementValue(
327  RootRenderableInterface $element,
328  array $propertyParts,
329  FormRuntime $formRuntime
330  ) {
331  if (empty($propertyParts)) {
332  throw new \InvalidArgumentException('The argument "propertyParts" is empty', 1476216007);
333  }
334 
335  $propertyType = 'properties';
336  $property = implode('.', $propertyParts);
337  $renderingOptions = $element->getRenderingOptions();
338 
339  if ($property === 'label') {
340  $defaultValue = $element->getLabel();
341  } else {
342  if ($element instanceof FormElementInterface) {
343  try {
344  $defaultValue = ‪ArrayUtility::getValueByPath($element->getProperties(), $propertyParts, '.');
345  } catch (MissingArrayPathException $exception) {
346  $defaultValue = null;
347  }
348  } else {
349  $propertyType = 'renderingOptions';
350  try {
351  $defaultValue = ‪ArrayUtility::getValueByPath($renderingOptions, $propertyParts, '.');
352  } catch (MissingArrayPathException $exception) {
353  $defaultValue = null;
354  }
355  }
356  }
357 
358  if (isset($renderingOptions['translation']['translatePropertyValueIfEmpty'])) {
359  $translatePropertyValueIfEmpty = $renderingOptions['translation']['translatePropertyValueIfEmpty'];
360  } else {
361  $translatePropertyValueIfEmpty = true;
362  }
363 
364  if (empty($defaultValue) && !$translatePropertyValueIfEmpty) {
365  return $defaultValue;
366  }
367 
368  $defaultValue = empty($defaultValue) ? '' : $defaultValue;
369  $translationFile = $renderingOptions['translation']['translationFile'] ?? null;
370  if (empty($translationFile)) {
371  $translationFile = $formRuntime->getRenderingOptions()['translation']['translationFile'];
372  }
373 
374  if (is_string($translationFile)) {
375  $translationFiles = [$translationFile];
376  } else {
377  $translationFiles = $this->‪sortArrayWithIntegerKeysDescending($translationFile);
378  }
379 
380  $language = null;
381  if (isset($renderingOptions['translation']['language'])) {
382  $language = $renderingOptions['translation']['language'];
383  }
384 
385  try {
386  $arguments = ‪ArrayUtility::getValueByPath($renderingOptions['translation']['arguments'] ?? [], $propertyParts, '.');
387  } catch (MissingArrayPathException $e) {
388  $arguments = [];
389  }
390 
391  $originalFormIdentifier = null;
392  if (isset($formRuntime->getRenderingOptions()['_originalIdentifier'])) {
393  $originalFormIdentifier = $formRuntime->getRenderingOptions()['_originalIdentifier'];
394  }
395 
396  if ($property === 'options' && is_array($defaultValue)) {
397  foreach ($defaultValue as $optionValue => &$optionLabel) {
398  $translationKeyChain = [];
399  foreach ($translationFiles as $translationFile) {
400  if (!empty($originalFormIdentifier)) {
401  if ($element instanceof FormRuntime) {
402  $translationKeyChain[] = sprintf('%s:%s.element.%s.%s.%s.%s', $translationFile, $originalFormIdentifier, $originalFormIdentifier, $propertyType, $property, $optionValue);
403  $translationKeyChain[] = sprintf('%s:element.%s.%s.%s.%s', $translationFile, $originalFormIdentifier, $propertyType, $property, $optionValue);
404  } else {
405  $translationKeyChain[] = sprintf('%s:%s.element.%s.%s.%s.%s', $translationFile, $originalFormIdentifier, $element->getIdentifier(), $propertyType, $property, $optionValue);
406  }
407  }
408  $translationKeyChain[] = sprintf('%s:%s.element.%s.%s.%s.%s', $translationFile, $formRuntime->getIdentifier(), $element->getIdentifier(), $propertyType, $property, $optionValue);
409  $translationKeyChain[] = sprintf('%s:element.%s.%s.%s.%s', $translationFile, $element->getIdentifier(), $propertyType, $property, $optionValue);
410  $translationKeyChain[] = sprintf('%s:element.%s.%s.%s.%s', $translationFile, $element->getType(), $propertyType, $property, $optionValue);
411  }
412 
413  $translatedValue = $this->‪processTranslationChain($translationKeyChain, $language, $arguments);
414  $optionLabel = empty($translatedValue) ? $optionLabel : $translatedValue;
415  }
416  $translatedValue = $defaultValue;
417  } elseif ($property === 'fluidAdditionalAttributes' && is_array($defaultValue)) {
418  foreach ($defaultValue as $propertyName => &$propertyValue) {
419  $translationKeyChain = [];
420  foreach ($translationFiles as $translationFile) {
421  if (!empty($originalFormIdentifier)) {
422  if ($element instanceof FormRuntime) {
423  $translationKeyChain[] = sprintf('%s:%s.element.%s.%s.%s', $translationFile, $originalFormIdentifier, $originalFormIdentifier, $propertyType, $propertyName);
424  $translationKeyChain[] = sprintf('%s:element.%s.%s.%s', $translationFile, $originalFormIdentifier, $propertyType, $propertyName);
425  } else {
426  $translationKeyChain[] = sprintf('%s:%s.element.%s.%s.%s', $translationFile, $originalFormIdentifier, $element->getIdentifier(), $propertyType, $propertyName);
427  }
428  }
429  $translationKeyChain[] = sprintf('%s:%s.element.%s.%s.%s', $translationFile, $formRuntime->getIdentifier(), $element->getIdentifier(), $propertyType, $propertyName);
430  $translationKeyChain[] = sprintf('%s:element.%s.%s.%s', $translationFile, $element->getIdentifier(), $propertyType, $propertyName);
431  $translationKeyChain[] = sprintf('%s:element.%s.%s.%s', $translationFile, $element->getType(), $propertyType, $propertyName);
432  }
433 
434  $translatedValue = $this->‪processTranslationChain($translationKeyChain, $language, $arguments);
435  $propertyValue = empty($translatedValue) ? $propertyValue : $translatedValue;
436  }
437  $translatedValue = $defaultValue;
438  } else {
439  $translationKeyChain = [];
440  foreach ($translationFiles as $translationFile) {
441  if (!empty($originalFormIdentifier)) {
442  if ($element instanceof FormRuntime) {
443  $translationKeyChain[] = sprintf('%s:%s.element.%s.%s.%s', $translationFile, $originalFormIdentifier, $originalFormIdentifier, $propertyType, $property);
444  $translationKeyChain[] = sprintf('%s:element.%s.%s.%s', $translationFile, $originalFormIdentifier, $propertyType, $property);
445  } else {
446  $translationKeyChain[] = sprintf('%s:%s.element.%s.%s.%s', $translationFile, $originalFormIdentifier, $element->getIdentifier(), $propertyType, $property);
447  }
448  }
449  $translationKeyChain[] = sprintf('%s:%s.element.%s.%s.%s', $translationFile, $formRuntime->getIdentifier(), $element->getIdentifier(), $propertyType, $property);
450  $translationKeyChain[] = sprintf('%s:element.%s.%s.%s', $translationFile, $element->getIdentifier(), $propertyType, $property);
451  $translationKeyChain[] = sprintf('%s:element.%s.%s.%s', $translationFile, $element->getType(), $propertyType, $property);
452  }
453 
454  $translatedValue = $this->‪processTranslationChain($translationKeyChain, $language, $arguments);
455  $translatedValue = empty($translatedValue) ? $defaultValue : $translatedValue;
456  }
457 
458  return $translatedValue;
459  }
460 
471  public function ‪translateFormElementError(
472  RootRenderableInterface $element,
473  int $code,
474  array $arguments,
475  string $defaultValue = '',
476  FormRuntime $formRuntime
477  ): string {
478  if (empty($code)) {
479  throw new \InvalidArgumentException('The argument "code" is empty', 1489272978);
480  }
481 
482  $validationErrors = $element->getProperties()['validationErrorMessages'] ?? null;
483  if (is_array($validationErrors)) {
484  foreach ($validationErrors as $validationError) {
485  if ((int)$validationError['code'] === $code) {
486  return sprintf($validationError['message'], $arguments);
487  }
488  }
489  }
490 
491  $renderingOptions = $element->getRenderingOptions();
492  $translationFile = $renderingOptions['translation']['translationFile'] ?? null;
493  if (empty($translationFile)) {
494  $translationFile = $formRuntime->getRenderingOptions()['translation']['translationFile'];
495  }
496 
497  if (is_string($translationFile)) {
498  $translationFiles = [$translationFile];
499  } else {
500  $translationFiles = $this->‪sortArrayWithIntegerKeysDescending($translationFile);
501  }
502 
503  $language = null;
504  if (isset($renderingOptions['language'])) {
505  $language = $renderingOptions['language'];
506  }
507 
508  $originalFormIdentifier = null;
509  if (isset($formRuntime->getRenderingOptions()['_originalIdentifier'])) {
510  $originalFormIdentifier = $formRuntime->getRenderingOptions()['_originalIdentifier'];
511  }
512 
513  $translationKeyChain = [];
514  foreach ($translationFiles as $translationFile) {
515  if (!empty($originalFormIdentifier)) {
516  if ($element instanceof FormRuntime) {
517  $translationKeyChain[] = sprintf('%s:%s.validation.error.%s.%s', $translationFile, $originalFormIdentifier, $originalFormIdentifier, $code);
518  $translationKeyChain[] = sprintf('%s:validation.error.%s.%s', $translationFile, $originalFormIdentifier, $code);
519  } else {
520  $translationKeyChain[] = sprintf('%s:%s.validation.error.%s.%s', $translationFile, $originalFormIdentifier, $element->getIdentifier(), $code);
521  }
522  $translationKeyChain[] = sprintf('%s:%s.validation.error.%s', $translationFile, $originalFormIdentifier, $code);
523  }
524  $translationKeyChain[] = sprintf('%s:%s.validation.error.%s.%s', $translationFile, $formRuntime->getIdentifier(), $element->getIdentifier(), $code);
525  $translationKeyChain[] = sprintf('%s:%s.validation.error.%s', $translationFile, $formRuntime->getIdentifier(), $code);
526  $translationKeyChain[] = sprintf('%s:validation.error.%s.%s', $translationFile, $element->getIdentifier(), $code);
527  $translationKeyChain[] = sprintf('%s:validation.error.%s', $translationFile, $code);
528  }
529 
530  $translatedValue = $this->‪processTranslationChain($translationKeyChain, $language, $arguments);
531  $translatedValue = empty($translatedValue) ? $defaultValue : $translatedValue;
532  return $translatedValue;
533  }
534 
539  public function ‪setLanguage(string ‪$languageKey)
540  {
541  $this->languageKey = ‪$languageKey;
542  }
543 
548  public function ‪getLanguage(): string
549  {
550  return ‪$this->languageKey;
551  }
552 
559  protected function ‪processTranslationChain(
560  array $translationKeyChain,
561  string $language = null,
562  array $arguments = null
563  ) {
564  $translatedValue = null;
565  foreach ($translationKeyChain as $translationKey) {
566  $translatedValue = $this->‪translate($translationKey, $arguments, null, $language);
567  if (!empty($translatedValue)) {
568  break;
569  }
570  }
571  return $translatedValue;
572  }
573 
577  protected function ‪initializeLocalization(string $locallangPathAndFilename)
578  {
579  if (empty($this->languageKey)) {
580  $this->‪setLanguageKeys();
581  }
582 
583  if (!empty($locallangPathAndFilename)) {
585  $languageFactory = GeneralUtility::makeInstance(LocalizationFactory::class);
586  $this->LOCAL_LANG = $languageFactory->getParsedData($locallangPathAndFilename, $this->languageKey);
587 
588  foreach ($this->alternativeLanguageKeys as $language) {
589  $tempLL = $languageFactory->getParsedData($locallangPathAndFilename, $language);
590  if ($this->languageKey !== 'default' && isset($tempLL[$language])) {
591  $this->LOCAL_LANG[$language] = $tempLL[$language];
592  }
593  }
594  }
595  $this->‪loadTypoScriptLabels();
596  }
597 
602  protected function ‪setLanguageKeys()
603  {
604  $this->languageKey = 'default';
605 
606  $this->alternativeLanguageKeys = [];
607  if (TYPO3_MODE === 'FE') {
608  $tsfe = $this->‪getTypoScriptFrontendController();
609 
610  if ($this->‪getCurrentSiteLanguage() instanceof ‪SiteLanguage) {
611  $this->languageKey = $this->‪getCurrentSiteLanguage()->‪getTypo3Language();
612  } elseif (isset($tsfe->config['config']['language'])) {
613  $this->languageKey = $tsfe->config['config']['language'];
614  if (isset($tsfe->config['config']['language_alt'])) {
615  $this->alternativeLanguageKeys[] = $tsfe->config['config']['language_alt'];
616  }
617  }
618 
619  if ($this->languageKey !== 'default' && empty($this->alternativeLanguageKeys)) {
621  ‪$locales = GeneralUtility::makeInstance(Locales::class);
622  if (in_array($this->languageKey, ‪$locales->getLocales(), true)) {
623  foreach (‪$locales->getLocaleDependencies($this->languageKey) as $language) {
624  $this->alternativeLanguageKeys[] = $language;
625  }
626  }
627  }
628  } elseif (!empty(‪$GLOBALS['BE_USER']->uc['lang'])) {
629  $this->languageKey = ‪$GLOBALS['BE_USER']->uc['lang'];
630  } elseif (!empty($this->‪getLanguageService()->lang)) {
631  $this->languageKey = $this->‪getLanguageService()->lang;
632  }
633  }
634 
640  protected function ‪loadTypoScriptLabels()
641  {
642  $frameworkConfiguration = $this->‪getConfigurationManager()
644 
645  if (!is_array($frameworkConfiguration['_LOCAL_LANG'] ?? null)) {
646  return;
647  }
648  $this->LOCAL_LANG_UNSET = [];
649  foreach ($frameworkConfiguration['_LOCAL_LANG'] as ‪$languageKey => $labels) {
650  if (!(is_array($labels) && isset($this->LOCAL_LANG[‪$languageKey]))) {
651  continue;
652  }
653  foreach ($labels as $labelKey => $labelValue) {
654  if (is_string($labelValue)) {
655  $this->LOCAL_LANG[‪$languageKey][$labelKey][0]['target'] = $labelValue;
656  if ($labelValue === '') {
657  $this->LOCAL_LANG_UNSET[‪$languageKey][$labelKey] = '';
658  }
659  } elseif (is_array($labelValue)) {
660  $labelValue = $this->‪flattenTypoScriptLabelArray($labelValue, $labelKey);
661  foreach ($labelValue as $key => $value) {
662  $this->LOCAL_LANG[‪$languageKey][$key][0]['target'] = $value;
663  if ($value === '') {
664  $this->LOCAL_LANG_UNSET[‪$languageKey][$key] = '';
665  }
666  }
667  }
668  }
669  }
670  }
671 
683  protected function ‪flattenTypoScriptLabelArray(array $labelValues, string $parentKey = ''): array
684  {
685  $result = [];
686  foreach ($labelValues as $key => $labelValue) {
687  if (!empty($parentKey)) {
688  $key = $parentKey . '.' . $key;
689  }
690  if (is_array($labelValue)) {
691  $labelValue = $this->‪flattenTypoScriptLabelArray($labelValue, $key);
692  $result = array_merge($result, $labelValue);
693  } else {
694  $result[$key] = $labelValue;
695  }
696  }
697  return $result;
698  }
699 
706  protected function ‪sortArrayWithIntegerKeysDescending(array $array)
707  {
708  if (count(array_filter(array_keys($array), 'is_string')) === 0) {
709  krsort($array);
710  }
711  return $array;
712  }
713 
719  protected function ‪getConfigurationManager(): ConfigurationManagerInterface
720  {
721  if ($this->configurationManager !== null) {
723  }
724 
725  $this->configurationManager = GeneralUtility::makeInstance(ObjectManager::class)
726  ->get(ConfigurationManagerInterface::class);
728  }
729 
735  protected function ‪getCurrentSiteLanguage(): ?SiteLanguage
736  {
737  if (‪$GLOBALS['TYPO3_REQUEST'] instanceof ServerRequestInterface) {
738  return ‪$GLOBALS['TYPO3_REQUEST']->getAttribute('language', null);
739  }
740  return null;
741  }
742 
746  protected function ‪getAllTypo3BackendLanguages(): array
747  {
748  $languages = array_merge(
749  ['default'],
750  array_values(‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['lang']['availableLanguages'] ?? [])
751  );
752 
753  return $languages;
754  }
755 
759  protected function ‪getLanguageService(): ‪LanguageService
760  {
761  return ‪$GLOBALS['LANG'];
762  }
763 
768  {
769  return ‪$GLOBALS['TSFE'];
770  }
771 }
‪TYPO3\CMS\Form\Domain\Runtime\FormRuntime
Definition: FormRuntime.php:97
‪TYPO3\CMS\Form\Service\TranslationService\setLanguage
‪setLanguage(string $languageKey)
Definition: TranslationService.php:534
‪TYPO3\CMS\Form\Service\TranslationService\translateFormElementValue
‪string array translateFormElementValue(RootRenderableInterface $element, array $propertyParts, FormRuntime $formRuntime)
Definition: TranslationService.php:321
‪TYPO3\CMS\Form\Service\TranslationService\getInstance
‪static TranslationService getInstance()
Definition: TranslationService.php:82
‪TYPO3\CMS\Form\Domain\Runtime\FormRuntime\getRenderingOptions
‪array getRenderingOptions()
Definition: FormRuntime.php:1022
‪TYPO3\CMS\Form\Service\TranslationService\getAllTypo3BackendLanguages
‪array getAllTypo3BackendLanguages()
Definition: TranslationService.php:741
‪TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface\getLabel
‪string getLabel()
‪TYPO3\CMS\Form\Service\TranslationService
Definition: TranslationService.php:43
‪TYPO3\CMS\Form\Service\TranslationService\getConfigurationManager
‪ConfigurationManagerInterface getConfigurationManager()
Definition: TranslationService.php:714
‪TYPO3\CMS\Form\Service\TranslationService\setLanguageKeys
‪setLanguageKeys()
Definition: TranslationService.php:597
‪TYPO3\CMS\Core\Localization\LocalizationFactory
Definition: LocalizationFactory.php:25
‪TYPO3\CMS\Form\Service\TranslationService\translateValuesRecursive
‪array translateValuesRecursive(array $array, $translationFile=null)
Definition: TranslationService.php:178
‪TYPO3\CMS\Core\Utility\Exception\MissingArrayPathException
Definition: MissingArrayPathException.php:26
‪TYPO3\CMS\Form\Service\TranslationService\translateFinisherOption
‪string translateFinisherOption(FormRuntime $formRuntime, string $finisherIdentifier, string $optionKey, string $optionValue, array $renderingOptions=[])
Definition: TranslationService.php:246
‪TYPO3\CMS\Form\Service\TranslationService\getLanguage
‪string getLanguage()
Definition: TranslationService.php:543
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
Definition: ConfigurationManagerInterface.php:22
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface\getConfiguration
‪array getConfiguration($configurationType, $extensionName=null, $pluginName=null)
‪TYPO3\CMS\Core\Localization\Locales
Definition: Locales.php:29
‪TYPO3\CMS\Form\Service\TranslationService\$LOCAL_LANG
‪array $LOCAL_LANG
Definition: TranslationService.php:49
‪TYPO3\CMS\Form\Service\TranslationService\processTranslationChain
‪string null processTranslationChain(array $translationKeyChain, string $language=null, array $arguments=null)
Definition: TranslationService.php:554
‪TYPO3\CMS\Form\Service\TranslationService\initializeLocalization
‪initializeLocalization(string $locallangPathAndFilename)
Definition: TranslationService.php:572
‪TYPO3\CMS\Form\Service
Definition: DatabaseService.php:3
‪TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface\getIdentifier
‪string getIdentifier()
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface\CONFIGURATION_TYPE_FRAMEWORK
‪const CONFIGURATION_TYPE_FRAMEWORK
Definition: ConfigurationManagerInterface.php:23
‪TYPO3\CMS\Form\Service\TranslationService\getTypoScriptFrontendController
‪TypoScriptFrontendController getTypoScriptFrontendController()
Definition: TranslationService.php:762
‪TYPO3\CMS\Core\Site\Entity\SiteLanguage
Definition: SiteLanguage.php:25
‪TYPO3\CMS\Form\Service\TranslationService\$LOCAL_LANG_UNSET
‪array $LOCAL_LANG_UNSET
Definition: TranslationService.php:58
‪TYPO3\CMS\Form\Service\TranslationService\translateFormElementError
‪string translateFormElementError(RootRenderableInterface $element, int $code, array $arguments, string $defaultValue='', FormRuntime $formRuntime)
Definition: TranslationService.php:466
‪TYPO3\CMS\Core\Utility\ArrayUtility\getValueByPath
‪static mixed getValueByPath(array $array, $path, $delimiter='/')
Definition: ArrayUtility.php:179
‪TYPO3\CMS\Form\Domain\Model\FormElements\FormElementInterface
Definition: FormElementInterface.php:36
‪TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface
Definition: RootRenderableInterface.php:27
‪TYPO3\CMS\Form\Service\TranslationService\$languageKey
‪string $languageKey
Definition: TranslationService.php:64
‪TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface\getRenderingOptions
‪array getRenderingOptions()
‪$locales
‪$locales
Definition: be_users.php:6
‪TYPO3\CMS\Form\Service\TranslationService\$alternativeLanguageKeys
‪array $alternativeLanguageKeys
Definition: TranslationService.php:70
‪TYPO3\CMS\Form\Service\TranslationService\$configurationManager
‪TYPO3 CMS Extbase Configuration ConfigurationManagerInterface $configurationManager
Definition: TranslationService.php:74
‪TYPO3\CMS\Form\Service\TranslationService\sortArrayWithIntegerKeysDescending
‪array sortArrayWithIntegerKeysDescending(array $array)
Definition: TranslationService.php:701
‪TYPO3\CMS\Form\Service\TranslationService\translate
‪mixed translate( $key, array $arguments=null, string $locallangPathAndFilename=null, string $language=null, $defaultValue='')
Definition: TranslationService.php:98
‪TYPO3\CMS\Form\Service\TranslationService\flattenTypoScriptLabelArray
‪array flattenTypoScriptLabelArray(array $labelValues, string $parentKey='')
Definition: TranslationService.php:678
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:97
‪TYPO3\CMS\Form\Domain\Runtime\FormRuntime
Definition: FormSession.php:3
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:23
‪TYPO3\CMS\Form\Service\TranslationService\loadTypoScriptLabels
‪loadTypoScriptLabels()
Definition: TranslationService.php:635
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:22
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface\getType
‪string getType()
‪TYPO3\CMS\Form\Service\TranslationService\getCurrentSiteLanguage
‪SiteLanguage null getCurrentSiteLanguage()
Definition: TranslationService.php:730
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:29
‪TYPO3\CMS\Form\Domain\Runtime\FormRuntime\getIdentifier
‪string getIdentifier()
Definition: FormRuntime.php:740
‪TYPO3\CMS\Form\Service\TranslationService\translateToAllBackendLanguages
‪array translateToAllBackendLanguages(string $key, array $arguments=null, array $translationFiles=[])
Definition: TranslationService.php:215
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Form\Service\TranslationService\getLanguageService
‪LanguageService getLanguageService()
Definition: TranslationService.php:754
‪TYPO3\CMS\Extbase\Object\ObjectManager
Definition: ObjectManager.php:25
‪TYPO3\CMS\Core\Site\Entity\SiteLanguage\getTypo3Language
‪string getTypo3Language()
Definition: SiteLanguage.php:236