This project is archived and is in readonly mode.
TranslationHelper#translate joins array
Reported by yury | May 23rd, 2010 @ 09:13 PM | in 2.3.8
if array of keys is passed to TranslationHelper#t it joins array of translations instead of returning array.
Suspected commit http://github.com/rails/rails/commit/2310aef29be306704c0361f1188200...
even in tests expected behavior is replaced with strange
one
- assert_equal ["foo", "bar"], translate(["foo", "bar"])
+ assert_equal "foobar", translate(["foo", "bar"])
Comments and changes to this ticket
-
Santiago Pastorino May 23rd, 2010 @ 09:46 PM
- Milestone set to 2.3.7
- Tag changed from 2.3.6, helpers, i18n to 2.3.6, helpers, i18n, patch
- State changed from new to open
-
Santiago Pastorino May 24th, 2010 @ 06:16 PM
- Assigned user changed from Santiago Pastorino to José Valim
Patches for master and 2-3-stable
-
Repository May 24th, 2010 @ 08:01 PM
- State changed from open to committed
(from [6b0616d1b8c8a3333020e34b4a160e4ec37a8889]) translation method of TranslationHelper module returns a SafeBuffer Array backport
[#4675 state:committed]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/6b0616d1b8c8a3333020e34b4a160e... -
Repository May 24th, 2010 @ 08:02 PM
(from [05c95b5c5815c0b3ae55fda7a897922b7f3ec2c7]) translation method for arrays on TranslationHelper module returns an array where values for keys of the form (.|_)html keys are html_safe
[#4675]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/05c95b5c5815c0b3ae55fda7a89792... -
The_Lord May 24th, 2010 @ 10:30 PM
Yeah except now it ALWAYS returns an array (I'm on edge rails 3 beta3):
$ rails c Loading development environment (Rails 3.0.0.beta3)
irb(main):001:0> include ActionView::Helpers
=> Object irb(main):002:0> t(:index)
=> ["Home page"]My en.yml file looks like this:
en:
index: Home pageWhen I use it inside a link_to method the rendered link looks like this: ["Home page"]
and for me it really isn't the desired behaviour.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 4675 TranslationHelper#translate joins array [#4675 state:committed]
- 4675 TranslationHelper#translate joins array [#4675]