Issue Bug Closed

#90619Translations doesn't work well

Luca Braun 03/02/20, 16:11 updated 10/14/26, 07:23

Description

I have some categories called “Allgemeine Dokumente” and “Unterkategorie” and translated it from german to english.

“Allgemeine Dokumente” -> “General Documents“
“Unterkategorie” -> “Subcategory”

I translated my example page but now the english title will be displayed always.

In my extension I just did something simple:

// PluginController

protected function defaultAction() {
  // Already imported the CategoryRepository class.
  $repository = $this->objectManager->get(CategoryRepository::class);
  $query = $repository->createQuery();
  $settings = $query->getQuerySettings();
  $settings->setRespectSysLanguage(true);
  // Language uid 0 === german, 1 === english
  $settings->setLanguageUid(0);
  $query->setQuerySettings($settings);
  $this->view->assign('categories', $query->execute());
}

Where is the problem? Why I get the “german” record with an english title?!

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Files 2

History 3

  1. Luca Braun changed subject Translations doesn't working well Translations doesn't work well target version <span data-processor="relativetime" data-value="2020-03-02T16:13:17+00:00" > 03/02/20, 16:13 </span>

  2. Benni Mack commented and changed status New Closed <span data-processor="relativetime" data-value="2026-10-14T07:23:01+00:00" > 10/14/26, 07:23 </span>

    Hey,

    this has been fixed with utiliziing setLanguageAspect() in v12, which is now 100% in line with the rest of TYPO3 Core, this way one can configure this properly in their queryAspects, also with MM / Categories.

    If you feel this is the wrong decision, let me know and I will re-open it.