-
Notifications
You must be signed in to change notification settings - Fork 29
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 ability to set custom units for ->getRelativeDate #3
Comments
Yeah nice one mate, will get onto it when I'm home.
|
I know this is an old issue but I really want to implement something for i18n. The problem is working with dates and especially with relative dates like Expressive Date it becomes quite complex. It's okay for some languages, but others, like Russian, can have 3 plural forms. Russian also requires that the "from now" suffix be placed in front of the date as a prefix, not a suffix. I'm thinking of using the Symfony translator for this but that does add a dependency to what is currently a lightweight package. For anyone that's using this I'd be interested to hear your thoughts. |
+1 localization would be awesome although it seems quite complex to do. |
What if for i18n support, you return back an array or something:
So "4 days ago" would be
And "3 weeks from now" would be
Then leave it up to the implementer to translate that to actual language? |
👍 For localization, any update? |
+1 |
It would also read better in some situations to change future dates to use a prefix instead, e.g. on an event page:
Would become:
Rather than
@kalenjordan's suggestion would allow for this, though passing in a custom message format would be good too, e.g.
|
I have added Laravel Localization support and added a pull-request |
Currently the
getRelativeDate
method only ouputs in english, it would be nice to be able to set a custom$units
array and theago
string to allow manual translation of the date.The text was updated successfully, but these errors were encountered: