date icon indicating copy to clipboard operation
date copied to clipboard

Return incorrect ordinals numbers to fr_CA

Open dramoslance opened this issue 3 years ago • 1 comments

Is it possible to include fr_CA to numbers in the following format: 12e ??

dramoslance avatar Jun 04 '21 00:06 dramoslance

Numbers of what? Because if you mean the day number, then in French (including fr_CA) day number should only have ordinal for the 1 => 1er. All other days does not have ordinal.

The reason is simple : you don't say "Mardi second Mars", you say: "Mardi deux Mars", no ordinal form.

So it should not be implemented in the regular translation. It would be grammatically wrong.

If you're still really sure you want to override this for you app, you can use:

\Carbon\Translator::get('fr_CA')->setTranslations([
    'ordinal' => function ($number) {
        return $number.($number === 1 ? 'er' : 'e');
    },
]);

kylekatarnls avatar Jun 04 '21 18:06 kylekatarnls