File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 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
13641364
13651365=== Dot-separated Keys [[dot-separated-keys]]
13661366
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.
13691369
13701370[source,ruby]
13711371----
13721372# bad
13731373I18n.t :record_invalid, scope: [:activerecord, :errors, :messages]
13741374
13751375# good
1376+ I18n.t :record_invalid, scope: 'activerecord.errors.messages'
13761377I18n.t 'activerecord.errors.messages.record_invalid'
1378+
1379+ # bad
1380+ I18n.t :title, scope: :invitation
1381+
1382+ # good
1383+ I18n.t 'title.invitation'
13771384----
13781385
13791386=== I18n Guides [[i18n-guides]]
You can’t perform that action at this time.
0 commit comments