Merged
Conversation
This current implementation is only handling english. The Translator class is fairly primitive but gives the extension point we'll need later on.
src/Traits/DifferenceTrait.php
Outdated
Member
|
This is looking good. How do you suggest we provide other languages than english ? |
Member
|
I was more inclined to see the implementation of the diff inside another object. Do you think that would make sense? |
src/ChronosInterface.php
Outdated
Member
There was a problem hiding this comment.
Shouldn't it be diffForHumans ?
Member
There was a problem hiding this comment.
It should.
I would also uppercase the removes: bool $absolute Removes
Member
Author
|
@lorenzo Ok. That might make it easier to integrate CakePHP's i18n subsystem. |
Having a separate object for the difference formatter will let us rip it out and replace it in CakePHP with a more complete i18n approach.
Member
Author
|
@lorenzo I've split out the formatter, let me know what you think. |
Member
|
Good job @markstory! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This shores up a big incompatibility between Carbon and Chronos. I've only implemented english, as I feel that is the minimal set of messages we need for compatibility. I also just didn't want to add any dependencies to chronos.
Refs cakephp/cakephp#7713