From 00b6a39ad5cf63cb6859b4fb59f02fa8e5880f4f Mon Sep 17 00:00:00 2001 From: Gabriel Lima Date: Mon, 14 Apr 2014 18:56:29 -0300 Subject: [PATCH 1/2] fix bug #4832 select language for email content when invite a friend --- lib/email_inviter.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/email_inviter.rb b/lib/email_inviter.rb index aa1c4d08b34..eaba723100e 100644 --- a/lib/email_inviter.rb +++ b/lib/email_inviter.rb @@ -2,6 +2,7 @@ class EmailInviter attr_accessor :emails, :message, :inviter, :locale def initialize(emails, inviter, options={}) + options = options.symbolize_keys self.message = options[:message] self.locale = options.fetch(:locale, 'en') self.inviter = inviter From f6c0648a55fcddd7db042050e0729ab6b743ca27 Mon Sep 17 00:00:00 2001 From: Gabriel Lima Date: Tue, 15 Apr 2014 09:23:58 -0300 Subject: [PATCH 2/2] bug #4832 - send the rspec test and changelog --- Changelog.md | 1 + spec/lib/email_inviter_spec.rb | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Changelog.md b/Changelog.md index 1a4ab6ff277..11c2b1741b6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -26,6 +26,7 @@ Read more in [#4249](https://github.com/diaspora/diaspora/pull/4249) and [#4883] * SPV: Improve padding and interaction counts [#4426](https://github.com/diaspora/diaspora/pull/4426) ## Bug fixes +* Fix email body language when invite a friend [#4832](https://github.com/diaspora/diaspora/issues/4832) * Improve time agos by updating the plugin [#4280](https://github.com/diaspora/diaspora/issues/4280) * Do not add a space after adding a mention [#4767](https://github.com/diaspora/diaspora/issues/4767) * Fix active user statistics by saving a last seen timestamp for users [#4734](https://github.com/diaspora/diaspora/issues/4734) diff --git a/spec/lib/email_inviter_spec.rb b/spec/lib/email_inviter_spec.rb index 1b6ae002e18..6220864ae6e 100644 --- a/spec/lib/email_inviter_spec.rb +++ b/spec/lib/email_inviter_spec.rb @@ -41,6 +41,11 @@ inviter.locale.should == 'en' end + it 'should symbolize keys' do + inviter = EmailInviter.new(@emails, @user, 'locale' => 'es') + inviter.locale.should == 'es' + end + it 'listens to the langauge option' do inviter = EmailInviter.new(@emails, @user, :locale => 'es') inviter.locale.should == 'es'