Rails I18n: 错误 'translation missing' 当我尝试翻译这个词时 "off"
Rails I18n: error 'translation missing' when i try translate this words "off"
为什么我不能翻译这个词?
config/locales/pt-BR.yml
pt-BR:
testing:
off: 'Desligado'
offff: 'Test'
rails 控制台
> I18n.t 'testing.offff'
=> "Test"
> I18n.t 'testing.off'
=> "translation missing: pt-BR.testing.off"
特殊词被限制,例如
'true, false, yes, no, on, off'
只需将密钥 'off' 更改为其他不受限制的密钥即可。
为什么我不能翻译这个词?
config/locales/pt-BR.yml
pt-BR:
testing:
off: 'Desligado'
offff: 'Test'
rails 控制台
> I18n.t 'testing.offff'
=> "Test"
> I18n.t 'testing.off'
=> "translation missing: pt-BR.testing.off"
特殊词被限制,例如
'true, false, yes, no, on, off'
只需将密钥 'off' 更改为其他不受限制的密钥即可。