Last Updated: January 28, 2019
·
4.625K
· francof

Rails i18n yes/no translation

Quick tip

keys in yaml are actually yaml content (has reserved words). So, translating things like yes, no, y, n, on or off will silently fail (evaluate to boolean in the key)
So instead of

yes: "si"

do

"yes": "si"

to make sure it's evaluated as a string instead of a boolean.

Full reference card for checking your keys can be found in: http://yaml.org/refcard.html

1 Response
Add your response

Thanks for the protip... Such a hassle.

over 1 year ago ·