File tree 1 file changed +9
-2
lines changed 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1364,16 +1364,23 @@ The value for `users.show.title` can be looked up in the template `app/views/use
1364
1364
1365
1365
=== Dot-separated Keys [[dot-separated-keys]]
1366
1366
1367
- Use the dot-separated keys in the controllers and models instead of specifying the `:scope` option.
1368
- The dot -separated call is easier to read and trace the hierarchy.
1367
+ Use dot-separated locale keys instead of specifying the `:scope` option with an array or a single symbol .
1368
+ Dot -separated notation is easier to read and trace the hierarchy.
1369
1369
1370
1370
[source,ruby]
1371
1371
----
1372
1372
# bad
1373
1373
I18n.t :record_invalid, scope: [:activerecord, :errors, :messages]
1374
1374
1375
1375
# good
1376
+ I18n.t :record_invalid, scope: 'activerecord.errors.messages'
1376
1377
I18n.t 'activerecord.errors.messages.record_invalid'
1378
+
1379
+ # bad
1380
+ I18n.t :title, scope: :invitation
1381
+
1382
+ # good
1383
+ I18n.t 'title.invitation'
1377
1384
----
1378
1385
1379
1386
=== I18n Guides [[i18n-guides]]
You can’t perform that action at this time.
0 commit comments