user12882
user12882

Reputation: 4792

How to correctly state internationalization keys/values in YAML files?

I am using Ruby on Rails 3.1.0 and I would like to know how to correctly state internationalization keys/values in YAML files (I have a couple of questions/doubts...). That is, I have a locale file containing the following code:

en:
  # Note the 'style' HTML property and the ':' at the end
  test_key_html: <span style='color: #4682B4;'>Test text</span>:
  1. How should I correctly add colon (punctuation) to a YAML file (maybe by using HTML code)?
  2. How should I properly state the HTML 'style' property in the YAML file? What do you advise about?

Upvotes: 0

Views: 396

Answers (1)

Chris Cherry
Chris Cherry

Reputation: 28574

Those translation files aren't meant to have HTML. I would avoid having the entire HTML string in there, instead just have the string "Test text" and move the html portion back into your template or helper.

Upvotes: 1

Related Questions