This project is archived and is in readonly mode.

#1294 ✓committed
Akira Matsuda

Add word separator for AR error messages

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

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.

Comments and changes to this ticket

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

Pages