LoginSignup
0

More than 5 years have passed since last update.

NetCommons3にデフォルトで用意されてるバリデーションメッセージ

Posted at

プラグインの開発中にサクっと参照したくなったのでまとめてみた。

利用例


'location_name' => array(
    'notBlank' => array(
        'rule' => array('notBlank'),
        // __d()の第2引数以降はsprintfと同様
        'message' => __d('net_commons', 'Please input %s.', __d('reservations', 'Location name')),
        //'allowEmpty' => false,
        //'required' => false,
        //'last' => false, // Stop validation after this rule
        //'on' => 'create', // Limit validation to 'create' or 'update' operations
    ),
),

定義済みメッセージ

GitHub上の最新ファイル : https://github.com/NetCommons3/NetCommons/blob/master/Locale/jpn/LC_MESSAGES/net_commons.po

下記は2017年3月24日現在の定義済みバリデーションメッセージです。

msgid "Invalid request."
msgstr "入力値が不正です。"

msgid "Please input %s."
msgstr "%sを入力してください。"

msgid "If it is not approved, comment is a required input."
msgstr "差し戻す場合は、必ずコメントを入力してください。"

msgid "Please enter comments to the person in charge."
msgstr "担当者へコメントがあれば、入力してください。"

msgid "Unauthorized pattern for %s."
msgstr "%sの書式が不正です。"

msgid "Unauthorized pattern for %s. Please input the data in %s format."
msgstr "%sの書式が不正です。%s形式で入力してください。"

msgid "Only alphabets and numbers are allowed."
msgstr "半角英数字を入力してください。"

msgid "Only alphabets, numbers and symbols are allowed."
msgstr "半角英数字または記号を入力してください。"

msgid "Only alphabets and numbers are allowed to use for %s."
msgstr "%sは半角英数字を入力してください。"

msgid "Only alphabets, numbers and symbols are allowed to use for %s."
msgstr "%sは半角英数字または記号を入力してください。"

msgid "Please choose at least %s characters string."
msgstr "%s文字以上で入力してください。"

msgid "Only numbers are allowed."
msgstr "数字を入力してください。"

msgid "Please enter more than %s."
msgstr "%s以上の数値を入力してください。"

msgid "The input %s must be a number bigger than %d and less than %d."
msgstr "%sは%d~%dまでの数値を入力してください。"

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
0