briannesbitt / Carbon

A simple PHP API extension for DateTime.
https://carbon.nesbot.com/
MIT License
16.57k stars 1.28k forks source link

🌎 Rules for ordinal in Occitan #2240

Closed Mejans closed 3 years ago

Mejans commented 3 years ago

Hello,

The function in Occitan to get the ordinal has to be changed.

I expected to get: if unit is year, week, hour, minute or second (feminin in Occitan:, annada, setmana, ora, minuta, segonda) => 1èra with 1, 2nda with 2 and in any other case Xena (X being a number: 3ena, 22ena, etc) else => 1èr with 1, 2nd with 2 and in any other case Xen (X being a number)

Thanks!

kylekatarnls commented 3 years ago

Hello,

Thanks for your help.

@Quenty31 wrote the current ordinal rule, I'll wait to know his opinion on this.

Thanks.

Quenty31 commented 3 years ago

Hello, yes this is the rule for Occitan, I confess I had used the Catalan rules and did not make the proper changes for this as we don't handle this grammatical point the same way.

Quenty31 commented 3 years ago

Woah, amazing and cleverly coded!

kylekatarnls commented 3 years ago

It will become even more clean with PHP 8 (stable version released yesterday): https://stitcher.io/blog/php-8-match-or-switch