Skip to content

Commit

Permalink
[WIP] translate without alternativeLanguageKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrichmathes committed Jul 12, 2024
1 parent d9db90f commit 83bb586
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Classes/Domain/Model/Labels.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,13 @@ public function offsetGet(mixed $identifier): ?string
$languageKey = $alternativeLanguageKeys = null;
}

// v13 TODO: alternativeLanguageKeys is deprecated https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.0/Breaking-100963-DeprecatedFunctionalityRemoved.html
// Calling LocalizationUtility::translate() with the argument $alternativeLanguageKeys will be removed in TYPO3 v13.0. Use Locales instead.
return LocalizationUtility::translate(
$this->generateLabelIdentifier($identifier),
null,
null,
$languageKey,
$alternativeLanguageKeys
$languageKey
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,12 @@ public static function translateValidationError(
array $alternativeLanguageKeys = null
): ?string {
foreach ($translationChain as $translatePrefix) {
// v13 TODO: alternativeLanguageKeys is deprecated
$translatedMessage = LocalizationUtility::translate(
$translatePrefix . $code,
$extensionName,
$arguments,
$languageKey,
$alternativeLanguageKeys
);
if ($translatedMessage) {
return $translatedMessage;
Expand Down
3 changes: 2 additions & 1 deletion Classes/ViewHelpers/Translate/LabelsViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public static function renderStatic(
*/
protected static function translate($id, $extensionName, $arguments, $languageKey, $alternativeLanguageKeys)
{
return LocalizationUtility::translate($id, $extensionName, $arguments, $languageKey, $alternativeLanguageKeys);
// v13 TODO: alternativeLanguageKeys is deprecated
return LocalizationUtility::translate($id, $extensionName, $arguments, $languageKey);
}
}

0 comments on commit 83bb586

Please sign in to comment.