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

Allow grammar rule customization for unit declensions #2587

Conversation

kylekatarnls
Copy link
Collaborator

@kylekatarnls kylekatarnls commented Apr 9, 2022

This will allow declension in Mongolian to apply only to the last part when the interval is a sequence of units:

When last unit can be shorten, we just get no declensions:

Carbon::now()
    ->subYears(2)
    ->subMonths(3)
    ->subDay()
    ->subSecond()
    ->locale('mn')
    ->diffForHumans(null, null, true, 4)
2 жил 3 сар 1 өдөр 1с өмнө

When last unit is entire, we get declension only on this last unit:

Carbon::now()
    ->subYears(2)
    ->subMonths(3)
    ->subDay()
    ->subSecond()
    ->locale('mn')
    ->diffForHumans(null, null, false, 4)
2 жил 3 сар 1 өдөр 1 секундын өмнө

Fix #2587
Fix #2565

👋 @lucifer-crybaby @Batmandakh your review is welcome. 🙏

@kylekatarnls kylekatarnls added the translation Rely to internationalization label Apr 9, 2022
@kylekatarnls kylekatarnls added this to the 2.58.0 milestone Apr 9, 2022
@kylekatarnls kylekatarnls merged commit e06036c into briannesbitt:master Apr 13, 2022
@kylekatarnls kylekatarnls deleted the fix/mongolian-declension-for-sequences branch April 14, 2022 13:24
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

Successfully merging this pull request may close these issues.

Declension in Mongolian with multi-units interval strings
2 participants