en:
  foo:
    - "item one"
    - "item two"
    - "item three"

I18n.translate(:foo)
 => ["item one", "item two", "item three"]


- Martin

On Thu, Jun 30, 2011 at 16:41, patrick99e99 <[email protected]> wrote:

> Hi,
>
> I am storing some text in a model that is separated by new lines, and
> I wanted to offer some default text in case the records in the model
> do not exist...  So I tried to emulate it by doing:
>
> en:
>  foo:
>    item1\r\n
>    item2\r\n
>    item3\r\n
>
> ..  However, when I retrieve this, it shows up as item1\\r\\nitem2\\r\
> \n
>
> where the "\"s are escaped.......  So in order to split my string by
> new lines, I have to do:
> text.split(/\r\n|\\r\\n/), which I am not crazy about.
>
> I was wondering if there is a simple way I can just make a list in
> yaml so that when I do t(:foo), i will get ["item1", "item2",
> "item3"] ?
>
> thanks.
>
> -patrick
>
> --
> You received this message because you are subscribed to the Google Groups
> "rails-i18n" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rails-i18n?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"rails-i18n" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-i18n?hl=en.

Reply via email to