-
-
Notifications
You must be signed in to change notification settings - Fork 411
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 support for uppercased date format directives #468
Add support for uppercased date format directives #468
Conversation
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.
LGTM 👍
lib/i18n/tests/localization/date.rb
Outdated
test "localize Date: given an abbreviated month name format it returns the correct abbreviated month name" do | ||
# TODO should be Mrz, shouldn't it? | ||
assert_equal 'Mar', I18n.l(@date, :format => '%b', :locale => :de) | ||
end | ||
|
||
test "localize Date: given an abbreviated and uppercased month name format it returns the correct abbreviated month name in upcase" do | ||
# TODO should be Mrz, shouldn't it? |
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.
Can this TODO be resolved please?
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.
Thank you very much! Let's resolve those TODOs and then we can ship this PR.
Sounds good! I've resolved the TODOs updating the month abbreviation, using https://github.com/unicode-cldr/cldr-dates-full/blob/6227cc013572391189a63350cec2544f0e0b3624/main/de/ca-gregorian.json#L63 as reference. |
Excellent! Thanks again |
Problem
Fixes: #463
Certain Ruby uppercased strftime directives are not parsed correctly in
i18n
, namely%^A
,%^a
,%^B
, and%^b
. These directives will always return the english version of the string.Before
Solution
Added support for the following uppercased date format directives:
%^A
,%^a
,%^B
, and%^b
After
cc: @blaszczakphoto @radar