11155
(-- --)
May 13, 2011, 4:16pm
1
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.
rab
(Rob Biedenharn)
May 13, 2011, 5:04pm
2
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'.
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
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.
--
Posted via http://www.ruby-forum.com/ .
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en .
Rob Biedenharn http://agileconsultingllc.com
Rob@AgileConsultingLLC.com
+1 513-295-4739
Skype: rob.biedenharn
11155
(-- --)
May 13, 2011, 5:16pm
3
Thanks Rob, your suggestion works!
I hope this is just a little weird yaml thing that has nothing to do
with
rails :).
Alexey.
11155
(-- --)
May 13, 2011, 6:15pm
4
It has been just point out to me that "yes" and "no" are keywords in
YAML.
Alexey.