Formatting date depending on language

Hi,
I’m trying to format the dates of my website based on the config file.
In french, I have set in fr.php

php

return [
    'code' => 'fr',
    'default' => true,
    'direction' => 'ltr',
    'locale' => [
        'LC_ALL' => 'fr_FR'
    ],
    'date' => [
        'format' => 'd MMMM Y'
];

And in English,

 'date' => [
        'format' => 'MMMM d, Y'
];

Is there a way I can use this easily?
$news->date()->toDate(kirby()->option($format = ‘option.date’)) or something similar ?
Thanks

You cannot add custom props in the language file (and certainly not fetch them via $kirby->options()). You would have to set these formats either in the translation variables or in your config.