Rootical V. Rootical V. - 1 year ago 142
YAML Question

How to break lines in .yml localization files on rails?

I have a terms.en.yml file with some localization, for example:

text: 'This agreement was written in English (US). To the extent any translated version of this agreement conflicts with the English version, the English version controls. Please note that Section 16 contains certain changes to the general terms for users outside the United States.\n\ Some new line'

How could i break a line or create a paragraph there?

Here`s some info but it did not helped to me,i had been doing something wrong.

Answer Source

This works for me:

  hello: "Hello world"
  bye: |
    See you!
  error: >
    Something happend.
    Try later.


irb(main):001:0> I18n.t 'bye'
=> "Bye!\nSee you!\n"
irb(main):002:0> I18n.t 'error'
=> "Something happend. Try later.\n"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download