[TYPO3-dev] Re: Extbase: translation handling
Cornel Widmer
cornel at webstobe.ch
Wed Jul 30 14:41:31 CEST 2014
Hi Alexander
Thanks for your reply. I'm on the newest release of extbase and typo3. So its version 6.2.0 of extbase.
I had a look at your extension and you're getting the original (default language) dataset. And I was trying to get the translated dataset. Exactly the opposite way.
After all I'm really aware of doing such things by myself because the framework should handle those cms-functionality by default. But now I've found a way "around".
When I set the following settings in the initializeObject-Method of the repository everything is fetched correctly and magically the translations where fetched corrected.
public function initializeObject() {
$querySettings = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
$querySettings->setRespectSysLanguage(false);
$this->setDefaultQuerySettings($querySettings);
}
Keep in mind that this settings also depend on the typoscript-settings (sys_language_mode, sys_language_overlay).
With this settings its not possible to have one category only in a specific language.
PS: After installing our extension and creating some default objects (categories, events, speakers, etc.) the list-view doesn't show any entries. Maybe theres some dependencies (typoscript-settings, beside storagePid) that should noted in the manual.
More information about the TYPO3-dev
mailing list