Set locale on single language site

We have a single language site that uses a plugin that provides templates and snippets for a calendar. That plugin makes use of the t() helper to allow for translations in a multilingual environment.

How do I set the locale on a single language site? Adding 'locale' => 'de_DE.utf-8' doesn’t seem to have any effect, the content always defaults to English.

Check this out: Exception messages and locale Maybe you can also set this in your config.

1 Like

Using Kirby\Toolkit\I18n::$locale = 'de'; actually works! :+1:
Is it a bug that Kirby doesn’t adapt to the config setting or is that intended behaviour?

See the discussion in the linked issue: https://github.com/getkirby/ideas/issues/459

I now added this to my plugin to make the language detection dynamic:

if (option('slugs')) {
    Kirby\Toolkit\I18n::$locale = option('slugs');
}