Base URL in "languages/en.php, de.php, ..." for Multilang / Multidomain Environment

Hi there,

we’re running our multi language Kirby (de & en) with separate Domains (live.domain.de & live.domain.com) and several Environments (preview.domain.de & preview.domain.com // dev.domain.de & dev.domain.com).

Base Url and translations are defined in separate language files (languages/de.php, languages/en.php).

Now my problem is, that i can just define one URL per language file e.g. in de.php - but what i like to do is, define three separate URLs based on the environment (live/dev/preview) like it could be done with config files “by domain”. (config.domain.com.php)

Following config is needed:

Maybe I just don’t get it how to do it the right way, so i need some hints :slight_smile:

It should work with a config option and config files per domain.

Config per domain:

return [
  'language-en' => 'https://live.domain.com', // etc.
];

Language files

'url' => option('language-en'),

Not tested.

Works perfect! Thank you so much.

We had to add 6 config files ( 3 configs (dev, preview, live) per language (de/en) ) and now it works like it should.