Line Break in String in config/locale internationalization file to show proper language format in view rails

StackOverflow https://stackoverflow.com/questions/22106147

Question

My client wants a string to show up as two sentences in the front. I am having trouble figuring out how I can do this.

for example in my config/locales/he-IL.yml file I have this

  home:
    instructions: "I am the world, please like ruby"

in my view I want it to show up as

I am the world please 
            like ruby 

its actually in hebrew, it should look like this

הכנס את קוד זיהוי המחקר שלך וקוד המשתתף שלך לשדות הבאים. נא ליצור קשר
                                           עמנו אם יש לך שאלות נוספות.

please note that its read from right to left. Right now I have it lump as one piece of string so its not entirely viewed correctly in the front.

I have tried double quoting, using a new line, google for regular expressions and checking out the rails internationalization docs. would anyone have an answer for this?

Was it helpful?

Solution

You can use html tags inside. Just add _html.

home:
    instructions_html: |
                  I am the world, <br/>
                  please like ruby
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top