-
Notifications
You must be signed in to change notification settings - Fork 107
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
Add basic Russian support #23
Conversation
@Forst thanks! Could you also please add one test before I merge that? Just like here: https://github.com/coduo/php-humanizer/blob/master/spec/Coduo/PHPHumanizer/DateTimeSpec.php#L175 |
@norzechowich Added a unit test for precise DateTime humanization according to how other languages were done. However, like other languages, "month/months" and "week/weeks" were not tested. Should I add such test cases as well? |
@Forst yes please, if this is not a problem for you of course. |
@norzechovicz Will do. One thing is not entirely clear for me: will 35 days difference convert to "5 weeks" or "1 month 5/6 days"? Also, should I add a test for separate items (i.e. not precise)? The tests are failing because, as I said, |
Ah right, prefix. Mmm sounds quite similar to #26 do you think its the same problem? |
#26 has exactly the same problem. I suggest we introduce |
I agree with @Forst. Introducing |
I think it's possible to go further. Ideally, there should be no need to translate seconds, hours, months and so on twice: once for simple and once for precise dates. Instead, there should be common translations for both cases: units:
seconds: 'second|seconds'
minutes: 'minute|minutes'
## snip ##
years: 'year|years'
special:
now_past: 'just now'
now_future: 'just now'
prefixes:
past: ''
future: ''
suffixes:
past: 'ago'
future: 'from now' |
@Forst that make sense, could you prepare a PR for that? |
@norzechowicz Will try to, I might need some help later on though. I'm closing this PR, will include Russian in the new request. |
@Forst thanks! Contact me if you would need any help. |
This commit adds basic Russian support to DateTimeDifference.
However, fixes are required. The compound items are supposed to be different for "past" and "future" dates. For now they're translated as "past". Also, the "future" prefix (
from_now
) goes before the text:The translation format is taken from Symfony/Component/Translation/PluralizationRules.php and has to be tested.