diff --git a/app/controllers/addresses_controller.rb b/app/controllers/addresses_controller.rb index af4adec..e4abfb6 100644 --- a/app/controllers/addresses_controller.rb +++ b/app/controllers/addresses_controller.rb @@ -6,7 +6,7 @@ class AddressesController < ApplicationController unless @address.blank? respond_with @address else - render(:json => {"errors" => {"address" => ["Could not find address."]}}, :status => 404) + render(:json => {"errors" => {"address" => [t("errors.address")]}}, :status => 404) end end end diff --git a/app/controllers/hydrants_controller.rb b/app/controllers/hydrants_controller.rb index f1c0903..195e77d 100644 --- a/app/controllers/hydrants_controller.rb +++ b/app/controllers/hydrants_controller.rb @@ -6,7 +6,7 @@ class HydrantsController < ApplicationController unless @hydrants.blank? respond_with @hydrants else - render(:json => {"errors" => {"address" => ["Could not find hydrants."]}}, :status => 404) + render(:json => {"errors" => {"address" => [t("errors.hydrants")]}}, :status => 404) end end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 010781f..ec4e502 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -9,7 +9,7 @@ class SessionsController < Devise::SessionsController sign_in(resource_name, resource) render(:json => resource) else - render(:json => {"errors" => {:password => ["You need to sign in or sign up before continuing."]}}, :status => 401) + render(:json => {"errors" => {:password => [t("errors.password")]}}, :status => 401) end end diff --git a/config/locales/en.yml b/config/locales/en.yml index be51fce..6a09d9e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -25,6 +25,10 @@ en: hydrant_name: "This hydrant" tagline: "Claim responsibility for shoveling out a fire hydrant after it snows." tos: "By signing up, you agree to the %{tos}." + errors: + address: "Could not find address." + password: "You need to sign in or sign up before continuing." + hydrants: "Could not find hydrants." labels: address: "Address, Neighborhood" city_state: "City"