Setlocale for non multilanguage sites

Earlier in days I could set my locale in the config file like this
setlocale(LC_ALL, 'de_DE.utf8', 'de_DE', 'de', 'ge');
But now this don’t seam to work… I’m not sure if it is since kirby 3.1 or even earlier.

How can I set my language to the preferred locale, so with 'date.handler' => 'strftime' the dates are in the right language?

Thanks for your help.

You can set it in your index.php

Thanks, but this doesn’t solve it either.

The language seems to be set correct. but my dates are not translated. Some times this didn’t work locally, but on the production server I hadn’t any problems. Also the locale are installed on my system.

Is the strftime datehandler enabled in your config?

Yes like so: 'date.handler' => 'strftime'

I think you need to set them in your languages: https://getkirby.com/docs/guide/languages/introduction#adding-languages

@bvdputte That doesn’t make sense for a single language website, though.

@jonathanhess I just checked the locale setting in config. There used to be a bug but it was supposed to be fixed.

Hm… I’ll check myself.

Edit: setting the locale in config.php works for me in a 3.1.0 Starterkit.

<?php

return [
    'debug' => true,
    'date.handler' => 'strftime',
    'locale' => 'de_DE.UTF-8',
];

Thanks @texnixe. Didn’t know you could do it the “kirby” way. I just did it the php-way… but yes, with

return [
    'locale' => 'de_DE.UTF-8',
];

it works great. Thanks again.