LoginSignup
6
4

More than 5 years have passed since last update.

Rails i18n エラーメッセージ 日本語化

Last updated at Posted at 2015-06-06

良いものを見つけたのでメモ。

  errors:
      messages:
        inclusion: "は一覧にありません。"
        exclusion: "は予約されています。"
        invalid: "が不正な値です。"
        confirmation: "が一致しません。"
        accepted: "を承諾してください。"
        empty: "が記入されていません。"
        blank: "が記入されていません。"
        too_long: "は{{count}}文字以内で記入してください。"
        too_short: "は{{count}}文字以上で記入してください。"
        wrong_length: "は{{count}}文字で記入してください。"
        taken: "はすでに使用されています。"
        not_a_number: "は数値で入力してください。"
        greater_than: "は{{count}}より大きい値を指定してください。"
        greater_than_or_equal_to: "は{{count}}以上の値を指定してください。"
        equal_to: "は{{count}}を指定してください。"
        less_than: "は{{count}}より小さい値を指定してください。"
        less_than_or_equal_to: "は{{count}}以下の値を指定してください。"
        odd: "は奇数を指定してください。"
        even: "は偶数を指定してください。"
        # Append your own errors here or at the model/attributes scope.

      models:
        # Overrides default messages

      attributes:
        # Overrides model and default messages.

参考
http://www.oiax.jp/rails/asagao_2/error_messages_i18n_1.html

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4