Skip to content

Commit

Permalink
audited all flashes for internationalization. saw failures for every …
Browse files Browse the repository at this point in the history
…flash & email eubject when locales/en.yml was altered.
  • Loading branch information
Dan Croak committed May 17, 2009
1 parent ca16aa9 commit be7d139
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
6 changes: 2 additions & 4 deletions app/controllers/clearance/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def create
else
flash.now[:failure] = translate(:unknown_email,
:scope => [:clearance, :controllers, :passwords],
:default => "Unknown email")
:default => "Unknown email.")
render :template => 'passwords/new'
end
end
Expand All @@ -38,9 +38,7 @@ def update
params[:user][:password_confirmation])
@user.confirm_email! unless @user.email_confirmed?
sign_user_in(@user)
flash[:success] = translate(:signed_in,
:scope => [:clearance, :controllers, :passwords],
:default => "Signed in.")
flash[:success] = translate(:signed_in, :default => "Signed in.")

This comment has been minimized.

Copy link
@marcelgoerner

marcelgoerner May 18, 2009

Did you really meant to switch back to flash without :scope or is it a mistake?

redirect_to url_after_update
else
render :template => 'passwords/edit'
Expand Down
4 changes: 1 addition & 3 deletions app/controllers/clearance/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ def create

def destroy
forget(current_user)
flash[:success] = translate(:signed_out,
:scope => [:clearance, :controllers, :sessions],
:default => "Signed out.")
flash[:success] = translate(:signed_out, :default => "Signed out.")
redirect_to url_after_destroy
end

Expand Down
2 changes: 1 addition & 1 deletion test/rails_root/config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.join(File.dirname(__FILE__), 'boot')
require 'md5' # Need this up here to generate the session[:secret] value down there
require 'md5'

Rails::Initializer.run do |config|
config.load_paths += Dir.glob(File.join(RAILS_ROOT, 'vendor', 'gems', '*', 'lib'))
Expand Down
17 changes: 9 additions & 8 deletions test/rails_root/config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
en:
clearance:
clearance:
models:
clearance_mailer:
change_password: Change your password
confirmation: Account confirmation
change_password: Change your password
confirmation: Account confirmation
controllers:
confirmations:
confirmations:
confirmed_email: Confirmed email and signed in.
passwords:
passwords:
deliver_change_password: You will receive an email within the next few minutes. It contains instructions for changing your password.
unknown_email: Unknown email
unknown_email: Unknown email.
sessions:
bad_email_or_password: Bad email or password.
unconfirmed_email: User has not confirmed email. Confirmation email will be resent.
users:
deliver_confirmation: You will receive an email within the next few minutes. It contains instructions for confirming your account.
signed_in: Signed in
signed_out: Signed out
signed_in: Signed in.
signed_out: Signed out.
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
$: << File.expand_path(File.dirname(__FILE__) + '/..')
require 'clearance'

gem 'thoughtbot-factory_girl' # from github
gem 'thoughtbot-factory_girl'

require 'factory_girl'
require 'redgreen' rescue LoadError
Expand Down

0 comments on commit be7d139

Please sign in to comment.