Issue with setLocale

Hey,

I have a Kirby 3 website with 2 languages (IT and DE).
Both language file have the following:

it.php

return [
    'code' => 'it',
    'default' => true,
    'direction' => 'ltr',
    'locale' => [
        'LC_ALL' => 'it_IT.utf8',
        'LC_TIME' => 'it_IT.utf8',
    ],
    'name' => 'Italiano',
    'translations' => [
    ],
    'url' => NULL
];

de.php

return [
    'code' => 'de',
    'default' => false,
    'direction' => 'ltr',
    'locale' => [
        'LC_ALL' => 'de_DE.utf8',
        'LC_TIME' => 'de_DE.utf8'
    ],
    'name' => 'Tedesco',
    'translations' => [
    ],
    'url' => NULL
];

In my config file I have set the following:

'date.handler' => 'strftime',

But I see the times in english… it is a bit strange.
I try to get the dates like this:

<?= $article->date()->toDate("%d %B %Y") ?

Someone can help me?

Thanks!

Can you try like below?

'LC_TIME' => ['de', 'de_DE', 'de_DE.utf8']
1 Like

Just added the language code before the LC_TIME:

'de_DE',
        'LC_TIME' => ['de', 'de_DE', 'de_DE.utf8']

and it works!
Thanks for the support

That looks wrong.

The problem seems to be this line:

 $code = $this->locale(LC_CTYPE);

in the source code, which returns null. So the LC_CTYPE should be set, and you probably have to set LC_ALL to the same settings as LC_TIME, not sure though.