Localizing "yes"/"no" does not work?

Hello, i have a strange issue, but maybe i just do not know some special
conventions.

If i put

fr:
yes: ‘oui’
no: ‘non’

in my fr.yml localization file, then <% t ‘yes’ %> produces ‘Yes’
instead of ‘oui’.
However any keys other than ‘yes’ and ‘no’ work fine: if i put

fr:
y: ‘oui’
n: ‘non’

then <% t ‘y’ %> gives ‘oui’ as expected.

Can anyone please explain to my why i cannot use ‘yes’ and ‘no’ as keys
in localization files?
Thanks.

Alexey.

On May 13, 2011, at 12:16 PM, Alexey M. wrote:

in my fr.yml localization file, then <% t ‘yes’ %> produces ‘Yes’
instead of ‘oui’.

Just a guess, but it might be a YAML thing. Try putting this:

fr:
“yes”: ‘oui’
“no”: ‘non’

To force the keys to be simple strings rather than thinking the bare
yes == true

-Rob

in localization files?
To post to this group, send email to rubyonrails-
[email protected]
To unsubscribe from this group, send email to
[email protected]
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
.

Rob B. http://agileconsultingllc.com
[email protected]
+1 513-295-4739
Skype: rob.biedenharn

Thanks Rob, your suggestion works!
I hope this is just a little weird yaml thing that has nothing to do
with rails :).

Alexey.

It has been just point out to me that “yes” and “no” are keywords in
YAML.

Alexey.