[TYPO3-english] Swap languages in whole installation

Bernd Wilke t3n at pi-phi.de
Thu Nov 12 15:50:17 CET 2015


Am 12.11.2015 um 14:59 schrieb Jan Kornblum:
> Dear newsgroup,
>
> i've got a quite adventurous intention ;)
>
> A medium sized website had wrongly been setup with sys_language_uid=0 to
> be english, sys_language_uid=1 to be german long time ago. But the
> projects domain is a german top level domain (please don't condemn me,
> it is not my fault)...
>
> Now the customer would like the german content to be default, and
> english content should be located below "domain.de/en".
>
> I'm currently thinking about the following approach: Shouldn't it be
> possible to just swap all sys_language_uid columns values in the
> affected tables? Like this:
>
> # Swap DE to a temporary "3"
> UPDATE tt_content SET sys_language_uid=3 WHERE sys_language_uid=1
> # Swap EN to "1"
> UPDATE tt_content SET sys_language_uid=1 WHERE sys_language_uid=0
> # Swap temporary cached DE to "0"
> UPDATE  tt_content SET sys_language_uid=0 WHERE sys_language_uid=3
>
> I think this need to be done for "tt_content" and some custom extensions
> tables. For "pages" itself this won't be possible due to
> "pages_overlay", but this replacement might be done manually...
>
> What do you think? Might this still result in a clean installation? Or
> are there any better approaches?

that problems is old. and no solution has been found yet.
it is not only about the field sys_language_uid in the 
(tt_content)records. but all translated records contain fields about 
translation-parents, these relations would go wired, as it is expected 
that the parent always has sys_language_uid = 0.

if you write a script (you can't solve it with pure SQL) you may read in 
a pair of records (default-lang and translation and swap the content of 
all fields except the language-parent relation (be aware: there also is 
a field for diffs which gets broken) then write these records back.

depending on your records and datastructure that might enough.
but if you have files (images) in your records (text with image): with 
FAL the relation got exported to sys_file_references (which has no 
sys_language_uid) and you need to correct those relation depending on 
the uids of the original (tt_content) records.


as far as all is about nice urls, you may persuade realurl to have the 
translation without language path segment and use a fixed pathsegment 
for the default language! (or all languages?)


bernd


More information about the TYPO3-english mailing list