A
A
Alexander Bagirov2015-04-28 19:34:52
ruby
Alexander Bagirov, 2015-04-28 19:34:52

Is it possible to cram multiple languages ​​into .yml?

Hello.
The Ruby application has a locales folder, which contains several files with a .yml extension. At the moment, they contain only translations in Mongolian. It looks, for example, like this:

mn:
  date:
    formats:
      default: "%Y-%m-%d"
      short: "%y-%m-%d"
      long: "%Y %B %d"

Is it possible to attribute ru:or en:and with the same structure to write lines in another language?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Bagirov, 2015-06-09
@alexbagirov

Yes, you can. It is enough to write in this format:

mn:
  date:
    formats:
      default: "%Y-%m-%d"
      short: "%y-%m-%d"
      long: "%Y %B %d"
ru:
  date:
    formats:
      default: "%Y-%m-%d"
      short: "%y-%m-%d"
      long: "%Y %B %d"

S
Shetani, 2015-04-28
@Shetani

In theory, you need to add the ru.yml and en.yml files to the locales folder and shove translations into them, you can read more here rails-internationalization

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question