Closed AbdullahAlhariri closed 1 year ago
Hello,
I can't tel for your case as you don't provide the code to run to reproduce your issue.
But Carbon supports alternative numbers via ->isoFormat()
in some languages (the languages where volunteer translators contributed to add them).
CarbonImmutable::parse('2023-01-28')
->locale('az_IR')
->isoFormat('dddd MMMM OD')
شنبه ژانویه ۲۸
If the locale you want should have it, but they are not in Carbon, you may propose a pull-request to add the missing alt_numbers
following this example:
https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Lang/az_IR.php#L26
Thank you for your response.
It appears that az_IR
is the Persian locale, which is written in Arabic script, but it's not arabic. The isoFormat
function does not seem to have an effect when the locale is set to ar_SA
(Saudi Arabia). It is likely that this behavior has been implemented intentionally.
There is no "intention" there. As said, isoFormat
will use alt_numbers
if someone provided the translations for it in the given language and no one contributed yet for this feature in ar
and ar_SA
, it's open-source, PRs are welcome, if you're fluent in Arabic add it there:
https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Lang/ar.php https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Lang/ar_SA.php
Provide some source/reference so it can compared.
sure, I'll contribute to it.
@kylekatarnls I have created a PR for this issue. see here
Thanks 🙏
Hello,
I noticed that the repository hasn't been updated in a while. But I was attempting to convert an date to Arabic, and I noticed that the numbers were not converted with the date. Did you forget to convert the numbers as well or was this implemented specifically as is?
Current output but should be: