A
A
Andrey Demidenko2015-04-15 14:05:41
Ruby on Rails
Andrey Demidenko, 2015-04-15 14:05:41

How to decline the model name in Russian in ru.yml?

Good afternoon. I use the rails_admin gem.
I make the locale in Russian. pointed out

#ru.yml
activerecord:
    models:
      contract:
        one: "договор"
        other: "договоры"

How to specify the declination for the model so that when outputting to rails_admin, the number of contracts is 15 contracts?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri, 2015-04-15
@Jazzis

Put the gem russian , and then using the pluralize or p method in the right place in the admin panel write:

Russian::p(<кол-во_договоров>, "договор", "договора", "договоров")

V
Viktor Vsk, 2015-04-15
@viktorvsk

Most likely many, but in general you won’t achieve particularly good results

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question