This project is archived and is in readonly mode.
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
-
Jeremy Kemper December 3rd, 2008 @ 05:14 PM
- Milestone cleared.
- State changed from new to open
-
Jeremy Kemper December 3rd, 2008 @ 05:14 PM
- Assigned user set to Jeremy Kemper
-
Repository December 8th, 2008 @ 11:59 PM
- State changed from open to committed
(from [c3b87dd4c99ba47d316bd03f99b5e23af1fe0ed8]) Make word separator in AR validation error messages configurable.
[#1294 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...
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
Tags
Referenced by
- 1397 Array#to_sentence(:locale => Asia) improvement Similar to #1294
- 1294 Add word separator for AR error messages [#1294 state:committed]
- 1687 Flexible formatting for AR validation error messages Some months ago a patch that adds an option to change the...