Changing the default language afterwards

What is the best way to change the default language afterwards. What should I pay special attention to and where should I change something?

The most tricky part about changing the default language when you already have content, regards fields that are set to translate: false, because their content is not present in the translations. So you would have to make sure that you don’t lose this content, i.e. you would have to store the content of these fields in the new default language, while removing it from the old default language.

Never change the default language without having a backup of your site.

Ah ok, that’s good to know! I didn’t use translate: false anywhere in the blueprints. I will test it :blush:

Oh, and one more thing: If you change the default language, the folder names will become the slugs of the new default language, so you will probably want to rename the folder names, while you will have to set the current folder names as slug for the current default language.

Note that renaming pages will affect blueprints and content where you still use ids instead of uuids to reference a page.

Thanks for the tips :slight_smile:

I found this old post and would like to add something that has worked for me. In addition to taking into account what @texnixe has pointed out, in case anyone finds it interesting, when you have a default language (e.g. EN) and you want to add a new one and leave it as default (e.g. ES) you can define the new default language in /site/languages/es.php and with the terminal go to /content and drop this command (Please, backup files before):

find . -type f -name "*.en.txt" | while read -r file; do
    cp "$file" "${file%.en.txt}.en.txt" cp "$file" "${file%.en.txt}.es.txt"
done

This will change all content inside /content recursively duplicating all content files in English to Spanish.
Now you only have to enter the new default language ES to translate from EN.
I hope this will be helpful to someone.