[TYPO3-english] Extbase - working with translation

Stephan Schuler Stephan.Schuler at netlogix.de
Tue Dec 5 23:23:17 CET 2017


Hey there.

That's not the way translations are meant to work in Extbase. You won't get very far unless you drop large parts of Extbase and work around that yourself.

You should not think in terms of records in Extbase but in terms of a rich domain model. In that mind set (at least the way Extbase provides it for you), there's no such thing as different translation records. There is only one entity that has different flavours depending on the environment. You are not meant to handle different recored UIDs for the original one or for the translation. The entity as one identifier, no matter which language you're looking at.

Of course your problem doesn't go away just because me telling you some very meta stuff. And I'm not trying to talk you out of this. But regular Extbase mechanisms just don't provide you with that kind of access.

Think about it like this: You can't query the repository "findByLanguage" twice with different language arguments and expect the same domain object to be returned as two different objects.
If they are returned as two different objects, then the language is part of your domain and not automatically handled by Extbase.
If the language is automtically handled by Extbase then the language is not part of your domain, thus both objects are equal. Ideally, they even are references to the very same thing, so `===` at PHP level returns true.

And that's the clue how to handle this: Don't use Extbase translation mechanisms (or TYPO3 translation mechanisms in general) but make the language part of your domain model. That, imho, is the only way to stay in the Extbase world for all the features we love on one hand but be able to handle translations yourelf on the other.

Regards,



Stephan Schuler
Softwareentwickler | netlogix Web Solutions

Telefon: +49 (911) 539909 - 0
E-Mail: Stephan.Schuler at netlogix.de
Web: websolutions.netlogix.de



----------------------------
Neu: Wir sind Amazon Web Services Partner. Mehr erfahren:
https://websolutions.netlogix.de/technologie/amazon-web-services-aws
----------------------------




netlogix GmbH & Co. KG
IT-Services | IT-Training | Web Solutions
Neuwieder Straße 10 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: info at netlogix.de | Web: http://www.netlogix.de

netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Matthias Schmidt



________________________________________
Von: typo3-english-bounces at lists.typo3.org <typo3-english-bounces at lists.typo3.org> im Auftrag von Jan Bednarik <info at bednarik.org>
Gesendet: Dienstag, 5. Dezember 2017 21:31
An: typo3-english at lists.typo3.org
Betreff: [TYPO3-english]  Extbase - working with translation

Hi,

I need to work with a translation of a record, but ExtBase loads record
with UID of the translation, I always get the default language. Is there
a setting or something to surpress this behavior?

What I'm trying to do is to translate records in FE, but when I get
translation, update it and save it, the original is updated and not the
translation.

Jan
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english


More information about the TYPO3-english mailing list