Skip to content
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

Merged
merged 3 commits into from
Feb 26, 2019

Conversation

jeffjyang
Copy link
Contributor

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

screen shot 2019-02-11 at 11 36 46 pm

Solution

Added support for the following uppercased date format directives:
%^A, %^a, %^B, and %^b

After

screen shot 2019-02-11 at 11 40 56 pm

cc: @blaszczakphoto @radar

Copy link

@mariusz-blaszczak mariusz-blaszczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

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?
Copy link
Collaborator

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?

Copy link
Collaborator

@radar radar left a 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.

@jeffjyang
Copy link
Contributor Author

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.

@radar radar merged commit 70daba7 into ruby-i18n:master Feb 26, 2019
@radar
Copy link
Collaborator

radar commented Feb 26, 2019

Excellent! Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants