typo3typo3-7.6.xrealurltypo3-8.xtypo3-8.7.x

How to migrate content after Switching default language in TYPO3?


I have site with multi domain and having multi-language Italian and English in TYPO3 8.7.4. Now, before switching language my default language was English here is configuration for this:

:: config ::

language = en
locale_all = english
sys_language_mode = content_fallback
htmlTag_langKey = en
sys_language_uid = 0

#Language configuration
[globalVar=GP:L=1]
    config{
        language = it
        locale_all = italian
        sys_language_mode = content_fallback
        htmlTag_langKey = it
        sys_language_uid = 1
    }
[global]

:: Backend Mod ::

mod.SHARED {
    defaultLanguageLabel = English
    defaultLanguageFlag = en
}

Now, I want to change my TYPO3 site default language from English to Italian. So, I have done revert configuration like this:

:: config ::

language = it
locale_all = italian
sys_language_mode = content_fallback
htmlTag_langKey = it
sys_language_uid = 1

#Language configuration
[globalVar=GP:L=1]
    config{
        language = en
        locale_all = english
        sys_language_mode = content_fallback
        htmlTag_langKey = en
        sys_language_uid = 0
    }
[global]

:: Backend Mod ::

mod.SHARED {
    defaultLanguageLabel = Italian
    defaultLanguageFlag = it
}

Now, I have issue with my existing content. How to migrate this content. It shows incorrectly. While I add content in Italian language it shows in English language. How can I fix this?


Solution

  • Switching default language after content has been added is not that easy. That would need DB migration due to language fields.

    Take a look at this extension, it might be a good starting point: https://github.com/dschledermann/lfswaplang

    In general: don't switch default languages in an existing project