EnumString localisation doesn't work for multi language sites
Reported by Betelgeuse | November 18th, 2011 @ 03:34 PM
ree-1.8.7-2011.03 :001 > FOO = HoboFields::Types::EnumString.for('a','b')
=> FOO
ree-1.8.7-2011.03 :002 > FOO.translated_values['a']
=> "English"
ree-1.8.7-2011.03 :003 > I18n.locale = :fi
=> :fi
ree-1.8.7-2011.03 :004 > FOO.translated_values['a']
=> "English"
ree-1.8.7-2011.03 :005 > I18n.t 'foos.a'
=> "Finnish"
This happens because translated values does memoization to a hash. This means that on a multi language site a form with an EnumString will always be rendered in the language that was first used to access to the form.
No comments found
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป