-
-
Notifications
You must be signed in to change notification settings - Fork 244
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 possibility to use translated short notations #229
add possibility to use translated short notations #229
Conversation
8b6a7ce
to
284b322
Compare
@@ -243,7 +243,16 @@ public function format($format) | |||
|
|||
// Short notations. | |||
if (in_array($character, ['D', 'M'])) { | |||
$translated = mb_substr($translated, 0, 3); | |||
$toTranslate = strtolower($original); | |||
$sortTranslated = $lang->trans($toTranslate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/sort/short/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor quibble that the variable $sortTranslated
should probably be $shortTranslated
instead. Otherwise, looks good to me.
284b322
to
329e774
Compare
Thanks! I just fixed the typo. |
@jenssegers, could you please let me know what you think of this pull request? Would you be able to merge the request? Please let me know if you want me to change anything. |
@@ -243,7 +243,16 @@ public function format($format) | |||
|
|||
// Short notations. | |||
if (in_array($character, ['D', 'M'])) { | |||
$translated = mb_substr($translated, 0, 3); | |||
$toTranslate = strtolower($original); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mb version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm more than willing to change this to mb_strtolower
, but the original source code uses strtolower
as well: https://github.com/jenssegers/date/blob/master/src/Date.php#L241
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just changed strtolower
to mb_strtolower
.
329e774
to
3e1b771
Compare
* use short notation translations if available * add short notation translations in German and Dutch * update tests
Is there anything more I can do to get this pull request accepted? Please let me know, @jenssegers. |
@jenssegers Would love to see this pull request accepted. So we can start providing some abbreviated translations too. Apparently what's appearing for an abbreviated Monday in Arabic translates as "However" in Google Translate lol. |
Fix for #226