rails,yml和&多行 [英] rails, yml, & multiline

查看:71
本文介绍了rails,yml和&多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一生都无法从区域设置文件中获取多行Yaml.

我尝试了多种解决方案的每一种组合,但都没有成功.

我尝试用双引号,单引号,\ n,下一行的值,缩进以及其他一些符号来标记key: |key: >.

在我看来,我只是在使用t('key')

我在这里把我的头发剪掉.还有其他建议或可能的原因,多行值的默认Yaml规范不起作用?

解决方案

在irb中鬼混,看来您可能想要:

key: |-
  abc
  def

i cannot for the life of me get multiline yaml from my locale files to work.

i have tried every combination of multiple solutions with no success.

i have tried key: |, key: >, with double quotes, with singles quotes, with \n, with the value on the next line, indented, and probably some others.

and in my view i am just using t('key')

im tearing my hair out over here. any other suggestions or possible reasons the default yaml specs for multiline values are not working?

解决方案

From some fooling around in irb, it looks like you might want:

key: |-
  abc
  def

这篇关于rails,yml和&多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆