I18n: models
This commit is contained in:
parent
e7e5b75ba4
commit
99bc4f69f4
|
@ -96,14 +96,11 @@ en:
|
||||||
|
|
||||||
## ActiveRecord
|
## ActiveRecord
|
||||||
|
|
||||||
### Attributes
|
### Models
|
||||||
|
|
||||||
```rb
|
```rb
|
||||||
User.model_name.human #=> "User"
|
User.model_name.human #=> "User"
|
||||||
Child.model_name.human(count: 2) #=> "Children"
|
Child.model_name.human(count: 2) #=> "Children"
|
||||||
User.human_attribute_for :name #=> "Name"
|
|
||||||
```
|
```
|
||||||
{:.light}
|
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
en:
|
en:
|
||||||
|
@ -113,6 +110,18 @@ en:
|
||||||
child:
|
child:
|
||||||
one: "Child"
|
one: "Child"
|
||||||
other: "Children"
|
other: "Children"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Attributes
|
||||||
|
|
||||||
|
```rb
|
||||||
|
User.human_attribute_for :name #=> "Name"
|
||||||
|
```
|
||||||
|
{:.light}
|
||||||
|
|
||||||
|
```yml
|
||||||
|
en:
|
||||||
|
activerecord:
|
||||||
attributes:
|
attributes:
|
||||||
user:
|
user:
|
||||||
# activerecord.attributes.<model>.<field>
|
# activerecord.attributes.<model>.<field>
|
||||||
|
|
Loading…
Reference in New Issue