\"hello, homie!\"" />
开发者

Interpolate inside a yaml list?

I know I can do:

开发者_C百科en:
  greeting:
    hello, %{name}!

t('greeting', {:name => "homie"}) => "hello, homie!"

but how can I do:

en:
  greetings:
    - Hey, %{name}
    - Wassup, %{name}

? It appears that interpolation is not performed on lists... Is there a way to do this?


You have to explicitly tell yaml what is multiline. That's the role of |

en:
  greetings: |
    - Hey, %{name}
    - Wassup, %{name}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜