Gernott / mask

TYPO3 Extension Mask
https://www.facebook.com/typo3mask
GNU General Public License v2.0
130 stars 86 forks source link

New Category-Field not localized in frontend #489

Closed TheRealMadMesi closed 2 years ago

TheRealMadMesi commented 2 years ago

I tried the new category field, but it seems to have a problem with translations. The element, as well as the category ("Sommer" -> "Estate"), was translated to Italian. But in the frontend (on the Italian page) I still get the default language of the category.

See title in screenshot: image

m41r commented 2 years ago

I can confirm this behaviour... maybe we can use something like the following to accomplish this:

$table = 'sys_category'; // or whatever
$item = [ /* the data array */ ];
$langUid = 1; // or whatever
$languageAspect = $this->context->getAspect('language');

$item = $this->getTyposcriptFrontendController()?->sys_page->getRecordOverlay(
    $table,
    $item,
    $langUid,
    $languageAspect->getOverlayType() === $languageAspect::OVERLAYS_MIXED
        ? '1'
        : 'hideNonTranslated'
);

return $item;
nhovratov commented 2 years ago

Thanks for the issue reporting and a possible solution. I will have a look.