Merge pull request #4929 from santosgabriel/develop

fix bug #4832 select language for email content when invite a friend
This commit is contained in:
Jonne Haß 2014-04-15 18:30:33 +02:00
commit 441cc062f8
3 changed files with 7 additions and 0 deletions

View file

@ -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) * SPV: Improve padding and interaction counts [#4426](https://github.com/diaspora/diaspora/pull/4426)
## Bug fixes ## 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) * 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) * 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) * Fix active user statistics by saving a last seen timestamp for users [#4734](https://github.com/diaspora/diaspora/issues/4734)

View file

@ -2,6 +2,7 @@ class EmailInviter
attr_accessor :emails, :message, :inviter, :locale attr_accessor :emails, :message, :inviter, :locale
def initialize(emails, inviter, options={}) def initialize(emails, inviter, options={})
options = options.symbolize_keys
self.message = options[:message] self.message = options[:message]
self.locale = options.fetch(:locale, 'en') self.locale = options.fetch(:locale, 'en')
self.inviter = inviter self.inviter = inviter

View file

@ -41,6 +41,11 @@ describe EmailInviter do
inviter.locale.should == 'en' inviter.locale.should == 'en'
end 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 it 'listens to the langauge option' do
inviter = EmailInviter.new(@emails, @user, :locale => 'es') inviter = EmailInviter.new(@emails, @user, :locale => 'es')
inviter.locale.should == 'es' inviter.locale.should == 'es'