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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug #4832 select language for email content when invite a friend #4929

Merged
merged 2 commits into from Apr 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions lib/email_inviter.rb
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions spec/lib/email_inviter_spec.rb
Expand Up @@ -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'
Expand Down