From 9f68e7c15dcafb2a052e39cd893850724346ab28 Mon Sep 17 00:00:00 2001 From: Piotrek Bator Date: Thu, 6 Feb 2020 20:37:41 +0100 Subject: [PATCH 1/2] Updated rspec dependency to not use 3.0 or newer --- polish.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polish.gemspec b/polish.gemspec index be74a6e..e9a03ee 100644 --- a/polish.gemspec +++ b/polish.gemspec @@ -25,6 +25,6 @@ Gem::Specification.new do |s| s.add_dependency "rake" s.add_dependency "bundler" - s.add_development_dependency "rspec", ">= 2.8.0" + s.add_development_dependency "rspec", ">= 2.8.0", "< 3.0" end From 5b2a023d4ea2a85b36cc49e8606e0d26ca9677ee Mon Sep 17 00:00:00 2001 From: Piotrek Bator Date: Thu, 6 Feb 2020 20:39:27 +0100 Subject: [PATCH 2/2] Added support for no-padded day of month (%-d) --- lib/polish/locale/datetime.rb | 2 +- spec/i18n/locale/datetime_spec.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/polish/locale/datetime.rb b/lib/polish/locale/datetime.rb index ee8e97c..3d5337f 100644 --- a/lib/polish/locale/datetime.rb +++ b/lib/polish/locale/datetime.rb @@ -4,7 +4,7 @@ :'pl' => { :date => { :month_names => lambda { |date_or_time, opts| - if opts[:format] =~ /(%d|%e)(.*)(%B)/ + if opts[:format] =~ /(%d|%-d|%e)(.*)(%B)/ [nil, 'stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia'] diff --git a/spec/i18n/locale/datetime_spec.rb b/spec/i18n/locale/datetime_spec.rb index 2da5484..6f9bea6 100644 --- a/spec/i18n/locale/datetime_spec.rb +++ b/spec/i18n/locale/datetime_spec.rb @@ -43,8 +43,10 @@ describe "with month names" do it "should use month names" do l(@date, :format => "%d %B").should == "01 grudnia" + l(@date, :format => "%-d %B").should == "1 grudnia" l(@date, :format => "%e %B %Y").should == " 1 grudnia 1985" l(@date, :format => "%d %B").should == "01 grudnia" + l(@date, :format => "%-d %B").should == "1 grudnia" l(@date, :format => "%e %B %Y").should == " 1 grudnia 1985" l(@date, :format => "A było to dnia %ego miesiąca %B %Y").should ==