rails/rails — pull request #6397 by kennyj (2012-05-19 16:43:00+00:00)
Title: Fix a problem of translate_exception method in Japanese.

When I execute rake command in activerecord directory, I have 2 failures.
I realize the cause of this problem - exception.message method returns localized messesage string.

```
$ ARCONN=postgresql ruby -Ilib:test test/cases/adapter_test.rb

1) Failure:
test_foreign_key_violations_are_translated_to_specific_exception(ActiveRecord::AdapterTest) [test/cases/adapter_test.rb:134]:
[ActiveRecord::InvalidForeignKey] exception expected, not
Class:
Message: <"PG::Error: ERROR: テーブル\"fk_test_has_fk\"への挿入、更新は外部キー制約\"fk_name\"に違反しています\nDETAIL: テーブル\"fk_test_has_pk\"にキー(fk_id)=(0)がありません\n: INSERT INTO fk_test_has_fk (fk_id) VALUES (0)">
---Backtrace---
/home/kennyj/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:790:in `async_exec'
/home/kennyj/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:790:in `block in execute'
/home/kennyj/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:288:in `block in log'
/home/kennyj/rails/activesupport/lib/active_support/notifications/instrumenter.rb:18:in `instrument'
/home/kennyj/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:283:in `log'
/home/kennyj/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:789:in `execute'
test/cases/adapter_test.rb:140:in `block in test_foreign_key_violations_are_translated_to_specific_exception'
---------------

2) Failure:
test_uniqueness_violations_are_translated_to_specific_exception(ActiveRecord::AdapterTest) [test/cases/adapter_test.rb:127]:
[ActiveRecord::RecordNotUnique] exception expected, not
Class:
Message: <"PG::Error: ERROR: 重複キーが一意性制約\"index_subscribers_on_nick\"に違反しています\nDETAIL: キー (nick)=(me) はすでに存在します\n: INSERT INTO subscribers(nick) VALUES('me')">
---Backtrace---
/home/kennyj/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:790:in `async_exec'
/home/kennyj/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:790:in `block in execute'
/home/kennyj/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:288:in `block in log'
/home/kennyj/rails/activesupport/lib/active_support/notifications/instrumenter.rb:18:in `instrument'
/home/kennyj/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:283:in `log'
/home/kennyj/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:789:in `execute'
test/cases/adapter_test.rb:128:in `block in test_uniqueness_violations_are_translated_to_specific_exception'
```