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.

Add word separator for AR error messages

#1294

Hi. I'm a Japanese Railer. I tried I18n translation on Rails 2.2.0, and felt a slight discomfort in the translated Japanese text.

For example, with a resource file like this,


ja-JP:
  activerecord:
    models:
      user: ユーザー
    attributes:
      user:
        name: 名前
    errors:
      messages:
        blank: を入力してください。

I got following validation error message.

名前 を入力してください。

This seems 90% okay, but as we Japanese usually don't separate words by space, we prefer a string like this.

名前を入力してください。

This patch enables to configure delimiter string for each locale (no test code yet, sorry).


ja-JP:
  activerecord:
    errors:
      format:
        # Sets the separator between the words
        separator: ""

This makes "my" app speak perfect Japanese (and maybe some other Asian languages like Chinese, Korean, Thai, Burmese, etc.), but I know it's not really a good design for all other developers... (they won't notice this parameter until they read the source code) So, any other better implementation idea are welcomed.

Reported by Akira Matsuda · October 30th, 2008 @ 09:20 AM

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

Activity

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

    December 3rd, 2008 @ 05:14 PM

  2. Jeremy Kemper
    Jeremy Kemper
    • Assigned user set to Jeremy Kemper

    December 3rd, 2008 @ 05:14 PM

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

    (from [c3b87dd4c99ba47d316bd03f99b5e23af1fe0ed8]) Make word separator in AR validation error messages configurable.

    [#1294 Add word separator for AR error messages state:committed]

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

    December 8th, 2008 @ 11:59 PM