Skip to content

Instantly share code, notes, and snippets.

@ebouchut
Last active August 29, 2015 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebouchut/f15def2deaefa59970ce to your computer and use it in GitHub Desktop.
Save ebouchut/f15def2deaefa59970ce to your computer and use it in GitHub Desktop.
Rails I18N (activemodel errors, simple_form labels and hints)
en:
# ~~~~~~~~
# Model Errors
# ~~~~~~~~
activemodel:
errors:
models:
bidrequest:
not_json: "Not a valid JSON"
url_not_valid: "Not a valid URL"
#
# ~~~~~~~~
# Controller
# ~~~~~~~~
bidrequest_failure: "Unable to send the Bid Request"
bidrequest_error: "Bid Request Error"
#
# ~~~~~~~~
# Simple Form
# ~~~~~~~~
simple_form:
labels:
bidrequest:
new:
title: "Send a Bid Request"
bid_request: "Bid Request"
bid_url: "Bidder URL"
hints:
bidrequest:
new:
bid_request: "Expected format is JSON"
#
# ~~~~~~~~
# View of BidrequestsController#send: app/views/bidrequests/send.html.erb
# <%= t(:'.title') %>
# Cf. http://guides.rubyonrails.org/i18n.html#looking-up-translations
# § 4.1.4 "Lazy" Lookup
# ~~~~~~~~
bidrequests:
send:
title: "Send a Bid Request"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment