Skip to content

Commit adde07e

Browse files
committed
Clarify Lazy lookup guideline a bit
"the texts" is quite vague, as it stands for: > strings and other locale specific bits (such as date or currency formats) I believe "entries" is a better term. Lazy lookup is also available in controllers, see https://github.com/rails/rails/blob/fee61e3abc878e4d4930a0be0accf8e4569009a8/actionpack/lib/abstract_controller/translation.rb#L11
1 parent 420937f commit adde07e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ Use the short form of the I18n methods: `I18n.t` instead of `I18n.translate` and
13421342

13431343
=== Lazy Lookup [[lazy-lookup]]
13441344

1345-
Use "lazy" lookup for the texts used in views. Let's say we have the following structure:
1345+
Use "lazy" lookup for locale entries from views and controllers. Let's say we have the following structure:
13461346

13471347
----
13481348
en:
@@ -1355,6 +1355,10 @@ The value for `users.show.title` can be looked up in the template `app/views/use
13551355

13561356
[source,ruby]
13571357
----
1358+
# bad
1359+
= t 'users.show.title'
1360+
1361+
# good
13581362
= t '.title'
13591363
----
13601364

0 commit comments

Comments
 (0)