Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Translation tool] fa #1815

Closed
hpez opened this issue Jul 27, 2019 · 7 comments
Closed

[Translation tool] fa #1815

hpez opened this issue Jul 27, 2019 · 7 comments
Assignees
Labels
translation Rely to internationalization
Milestone

Comments

@hpez
Copy link
Contributor

hpez commented Jul 27, 2019

To be fixed by #1817:

English fa comments
2 years 2 سال ۲ سال
2yrs 2 سال ۲ سال
1 year 1 سال ۱ سال
2 months 2 ماه ۲ ماه
2mos 2 ماه ۲ ماه
1 month 1 ماه ۱ ماه
2 weeks 2 هفته ۲ هفته
2w 2 هفته ۲ هفته
1 week 1 هفته ۱ هفته
2 days 2 روز ۲ روز
2d 2 روز ۲ روز
1 day 1 روز ۲ روز
2 hours 2 ساعت ۲ ساعت
2h 2 ساعت ۲ ساعت
1 hour 1 ساعت ۱ ساعت
2 minutes 2 دقیقه ۲ دقیقه
2m 2 دقیقه ۲ دقیقه
1 minute 1 دقیقه ۱ دقیقه
2s 2 ثانیه ۲ ثانیه
1 second 1 ثانیه ۱ ثانیه

Numbers should all be persian numbers as I have corrected among a few minor issues


To be fixed in translations

English fa comments
an hour یک دقیقهیک ساعت یک ساعت
2 seconds چند ثانیه ۲ ثانیه
a few seconds 1 ثانیه چند ثانیه
2 hours ago 2 ساعت پیش ۲ ساعت پیش
2 hours from now در 2 ساعت ۲ ساعت دیگر
2 hours before 2 ساعت پیش از ۲ ساعت پیش از
2 hours after 2 ساعت پس از ۲ ساعت پس از
@kylekatarnls
Copy link
Collaborator

Thanks @hpez, currently we can only handle custom number either globally or nowhere. So I have to know if it's also correct to use persian numbers in year: is ۲۰۱۹ better than 2019 and the same for day of the month or any numbers what Carbon would output translated in fa locale?

@hpez
Copy link
Contributor Author

hpez commented Jul 27, 2019

Yes it is correct for using it anywhere in fa locale.

@kylekatarnls
Copy link
Collaborator

I just check and persian numbers are already properly output in years and days of month. This is a general issue, alternative numbers (for all languages using them) are not displayed in translated duration strings. I will open a dedicated issue.

@kylekatarnls
Copy link
Collaborator

Hi, so I split the fix related to #1817 and the pure translation fixes. For the from_now/ago/before/after, I will need more input as we need the complete rule for all units and quantities.

I also need to know if the current translations are wrong or just a bit less accurate to decide if it worth to change them.

Right now, static wording is used:
https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Lang/fa.php#L43

But custom rules can be handled using closure:
https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Lang/ru.php#L67
https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Lang/tk_TM.php#L64
https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Lang/ka.php#L48

@kylekatarnls kylekatarnls added details needed We do not have enough input to solve this issue translation Rely to internationalization labels Jul 27, 2019
@kylekatarnls kylekatarnls added this to the 2.23 milestone Jul 27, 2019
@hpez
Copy link
Contributor Author

hpez commented Jul 27, 2019

There are rather small but I think necessary fixes to the fa locale file which I made a pull request for regarding this issue.

@kylekatarnls
Copy link
Collaborator

Thanks!

@kylekatarnls kylekatarnls removed the details needed We do not have enough input to solve this issue label Jul 31, 2019
@kylekatarnls
Copy link
Collaborator

Finally the current behavior will be kept as it seems in many language where we support alternative numbers, the digits 0..9 can be used. And for some languages where it could be relevant, we simply don't have the list of digits and rules in our translation files.

So with 2.23.0, you will be able to get duration translated strings (forHumans, diffForHumans, ago, fromNow etc.) with alternative numbers using:

->forHumans(['altNumbers' => true]); // for all locales
->forHumans(['altNumbers' => 'fa']); // for fa* locales
->forHumans(['altNumbers' => ['fa', 'ja']]); // for fa* and ja* locales

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
translation Rely to internationalization
Projects
None yet
Development

No branches or pull requests

2 participants