Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails I18n: error 'translation missing' when i try translate this words "off"

Why I can't translate this word?

config/locales/pt-BR.yml

pt-BR:
  testing:
    off: 'Desligado'
    offff: 'Test'

rails console

> I18n.t 'testing.offff'
=> "Test"
> I18n.t 'testing.off'
=> "translation missing: pt-BR.testing.off"
like image 362
Douglas Resende Avatar asked Oct 25 '25 05:10

Douglas Resende


1 Answers

Special words are restricted such as

'true, false, yes, no, on, off'

Juste change the key 'off' to something else, which is not restricted.

The doc about booleans in YAML

like image 69
Defoncesko Avatar answered Oct 26 '25 18:10

Defoncesko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!