Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

TranslationHelper#translate joins array

#4675

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"])

Reported by yury · May 23rd, 2010 @ 09:13 PM

State: committed
Milestone: 2.3.8
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Santiago Pastorino
    Santiago Pastorino
    • 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

    May 23rd, 2010 @ 09:46 PM

  2. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.7 to 2.3.8

    May 24th, 2010 @ 09:40 AM

  3. Santiago Pastorino
    Santiago Pastorino
    • Assigned user changed from Santiago Pastorino to José Valim

    Patches for master and 2-3-stable

    May 24th, 2010 @ 06:16 PM

  4. Santiago Pastorino
  5. Repository
    Repository
    • State changed from open to committed

    (from [6b0616d1b8c8a3333020e34b4a160e4ec37a8889]) translation method of TranslationHelper module returns a SafeBuffer Array backport

    [#4675 TranslationHelper#translate joins array state:committed]

    Signed-off-by: José Valim jose.valim@gmail.com
    http://github.com/rails/rails/commit/6b0616d1b8c8a3333020e34b4a160e...

    May 24th, 2010 @ 08:01 PM

  6. Repository
    Repository

    (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 TranslationHelper#translate joins array]

    Signed-off-by: José Valim jose.valim@gmail.com
    http://github.com/rails/rails/commit/05c95b5c5815c0b3ae55fda7a89792...

    May 24th, 2010 @ 08:02 PM

  7. The_Lord
    The_Lord

    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 page

    When 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.

    May 24th, 2010 @ 10:30 PM

  8. José Valim
    José Valim

    The symbol case is also fixed in my branch. Pushing soon.

    May 24th, 2010 @ 10:33 PM