[TYPO3-mvc] Create localizations in FE / on demand / on import?

Franz Koch typo3.RemoveForMessage at elements-net.de
Fri Sep 3 03:53:29 CEST 2010


Hey there,

has anybody found a way to create localized records with extbase? While 
retrieving is done automatically, I wonder how to create one. I'm 
currently sitting on a import script where I'd like to convert a 
existing table to my domain structure and haven't found a way to 
properly import translated records.

DomainObject have the following internal properties:
uid
_localizedUid
_languageUid

According to the doc comments a translated object gets filled like this:

uid (uid if translated record)
_localizedUid (l18n_parent)
_languageUid (sys_language_uid)


But if I do so and persist my objects, extbase is overwriting the object 
in the original language and not creating a new localization. That's why 
I think the doc comments are wrong and the fields actually work like this:

uid (always the uid of object in default language)
_localizedUid (uid of the merged translated object)
_languageUid (sys_language_uid)


If so, I wonder how I should create the _localizedUid on the fly, when 
the translated object I'm creating doesn't have a UID for the 
_localizedUid yet? It wouldn't be a problem if I could set the 
l18n_parent by hand (or the way the doc comments say), but that doesn't 
seem to be possible.

The only way I currently see is:
- create a new object with the localized data with defined _languageUid
- persist this object to get the uid
- remap the uid to _localizedUid and set the uid from the default 
language object
- persist object again and hope that worked


Does anybody have a better idea or a solution? I'm struggling for quite 
some time with this now :(

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list