-
Notifications
You must be signed in to change notification settings - Fork 0
Rails I18n
Teddy Wing edited this page Apr 3, 2018
·
2 revisions
syntax | description |
---|---|
"foo.bar".t |
equivalent to I18n.t("foo.bar")
|
Catalog.t |
gets the human name of the Catalog model (plural by default) |
Catalog.ts |
gets the human name of the Catalog model (singular) |
Catalog.tmf('name') |
gets the human name of the Catalog model's name attribute |
Catalog.t_action('new') |
gets the human name of the Catalog model's new action label (falls back on generic action labels) |
Furthermore, all these methods get the following features:
- fallback on the
default
key: if the lookup forfoo.bar.baz.bat
is unsucessful, we'll look forfoo.bar.default.bat
, thenfoo.default.bat
, etc. - missing keys display + logging: in development mode, missing keys are signaled in the UI and logged in
log/missing_keys.log