LoginSignup
4
7

More than 5 years have passed since last update.

RailsでcarrierwaveのI18n設定をする

Last updated at Posted at 2014-10-17

Railsでcarrierwaveを使う場合、Gemを入れただけの状態だとエラーが発生した際に、こんな表示になってしまう。

Photos imagetranslation missing: ja.errors.messages.extension_white_list_errorとPhotos imageを入力してください。

これはI18n設定が足りないためで、READMEに書いてあるとおり以下を翻訳ファイルに追加する必要がある。

errors:
  messages:
    carrierwave_processing_error: "Cannot resize image."
    carrierwave_integrity_error: "Not an image."
    carrierwave_download_error: "Couldn't download image."
    extension_white_list_error: "You are not allowed to upload %{extension} files, allowed types: %{allowed_types}"
    extension_black_list_error: "You are not allowed to upload %{extension} files, prohibited types: %{prohibited_types}"

追記: 言語毎の設定ファイルがここにありました。

4
7
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
4
7