Default language on multi-domain site

Hello,

On kirby 2.x.x the languages were defined in the config file. On this case I could set the default language specific for every used domain.

Now that in kirby 3.x.x the languages moved to its own files how can I set the default language based on the loaded config/domain?

Thanks,
frank

I haven’t tried that but it should be possible to set the default language based on a custom config setting.

Hello,

In my site/languages/de.php I used the following if/else statement:

'default' => (kirby()->option('language') == 'de') ? true : false,

Thanks for the help!

You need to set this for the other languages or at least one other language as well, I think. Better even provide a default value as second. param of the option helper:

de.php

'default' => (kirby()->option('language', 'de') == 'de') ? true : false,

en.php

'default' => (kirby()->option('language', 'de') == 'en') ? true : false,

etc.

Thank you for the code!