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.

Array#to_sentence(:locale => Asia) improvement

#1397

Similar to #1294 Add word separator for AR error messages

Array#to_sentence method cannot properly handle the corresponding expression in Eastern languages which don't use those characters (like Japanese, Chinese, etc).

Problem here again, is that comma and space character are hardcoded inside the "I18n ready" source code.

This patch moves these "Western" characrers into the locale resource file, without changing the default en-US behavior.

This enables Array#to_sentence to generate a natural spoken Japanese with the following locale settings.


ja-JP:
  support:
    array:
      words_connector: "と"
      two_words_connector: "と"
      last_word_connector: "と"

Reported by Akira Matsuda · November 18th, 2008 @ 05:22 AM

State: committed
Milestone: none
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • Assigned user set to Jeremy Kemper
    • Milestone cleared.
    • State changed from new to open

    December 3rd, 2008 @ 05:15 PM

  2. Sven Fuchs
  3. Repository
    Repository
    • State changed from open to committed

    (from [273c770011ab43d4b523caacb808bce070922d77]) Change Array#to_sentence I18n options to pass comma and space character from outside.

    [#1397 Array#to_sentence(:locale => Asia) improvement state:committed]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...

    December 8th, 2008 @ 11:54 PM