Internationalize errors
This commit is contained in:
parent
0e225663d7
commit
91c73248d7
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue