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. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 13, 2011, at 12:16 PM, Alexey Muranov wrote:> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en > . >Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org +1 513-295-4739 Skype: rob.biedenharn -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks Rob, your suggestion works! I hope this is just a little weird yaml thing that has nothing to do with rails :). 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
It has been just point out to me that "yes" and "no" are keywords in YAML. 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.