Is it possible to define the fallback language for each language?
E.g. if you have german as default language it is fallback for Swiss, Austria, …
When you have Japanese the fallback language should be english.
Is this possible?
Not sure I understand your question, because you are mixing languages and countries. In which languages does your site exist? Are you talking about automatic language detection, or the fallback when content in one of the languages does not exist?
Hi Sonja,
thank you for your time!
The default language is german and afterwards we set up the english version.
Now we have a japanese translation and need to change the default language.
But when I change it via the config file the slugs in english are german and vice versa.
That’s why I was wondering if it is possible to define a fallback language for each language…
For the default language, Kirby uses the folder names. Therefore, it doesn’t make sense to change the default language without also changing the folder names and then set the slug for the new non-default language via the slug attribute in the content files.
For that reason, you also cannot set a different default language.
I guess you want to show content that is not available in Japanese yet in English as fallback? Also I don’t know what that has got to do with Switzerland or Austria, as these don’t need a fallback language (unless you have Swiss and Austrian as translations as well?)
You are absolutely right: I want to show content that is not available in Japanese yet in English as fallback. Do you have an idea?
In that case it might make sense to change the default language to English, yes.
What I would do in this case, is
- make a backup of your content before you do anything!
- change default language to English manually in the language configuration
- make sure that all your pages have a content txt file in the new default language
- Then programmatically read the current folder names and add them as slug to the content of the former default language (de), and then rename the folders according to the slugs stored in the new default language.
Thanks a lot for your feedback!
Ah, and one more important thing: If you have used translate: false
on any fields in the default language, then you have to take care of that as well, so you don’t lose any content.