如何在存储单元`number_to_human_size`的yml文件上设置格式

Raj*_*ajG 2 ruby ruby-on-rails internationalization ruby-on-rails-3

代码是否正确格式为number_to_human_size?我把它们放在五岁以下,[en:,es:,de:,it:,fr:].mil文件.

storage_units:
  format: "%n %u"
  units:
    byte:
      one: "Byte"
      other: "Bytes"
    kb: "KB"
    mb: "MB"
    gb: "GB"
    tb: "TB"
Run Code Online (Sandbox Code Playgroud)

我有以下参考

<%= number_to_human_size(@game.downloadsize, :precision => 2, :locale=>I18n.locale) %>
Run Code Online (Sandbox Code Playgroud)

我收到错误消息:

无法从C:/ Documents and Settings/rajg/antixdiscoveraws/config/locales/de.yml加载翻译,期望它返回一个哈希值,但不会

任何帮助深表感谢.

SG *_* 86 5

尝试缩进格式:

storage_units:
  format: "%n %u"
  units:
    byte:
      one: "Byte"
      other: "Bytes"
    kb: "KB"
    mb: "MB"
    gb: "GB"
    tb: "TB"
Run Code Online (Sandbox Code Playgroud)