Open tguichaoua opened 6 months ago
This is something I previously considered when I took over time
in 2019. I was talked out of it at the time, though having basic support for localization is something I was recently reconsidering. The API wouldn't quite be what you have, but it wouldn't be that far off.
@jhpratt Could you make a suggestion for the API? Currently on vacation and willing to take a crack at it if you can provide the general direction, which (as you said) isn't the above suggestion
I could also just make a suggestion via a PR if that's preferred :D
For this specifically, I'd prefer not having a PR as it'll involve some code generation that will most likely end up in a separate repository.
Gotcha! Any way I can help move this forward or support you with this?
Not really at this point. I have other priorities, so it's not going to happen in the immediate future.
It should be possible to make
format
methods localizable by passing a structLocalization
with the month and weekday names. This struct is passed down tofmt_month
andfmt_weekday
methods that used it instead of the hardcodedMONTH_NAMES
andWEEKDAY_NAMES
.