-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I18n support for all Grape exceptions #306
Comments
There's nothing built-in into Grape for this, but since this is something that happens at runtime, can you just do the translation as you do it for the rest of your strings? |
Hi, I found grape denpends on activesupport, and activesupport depends on I18n, will this be a feature |
If you contribute it, I would definitely take it. |
thanks, I'll try it later |
There're several places where Grape calls raise with message text. We want all exceptions to start inheriting a base class and add i18n support everywhere. Mongoid does a fantastic job at this, which I've reused in the heroku-forward gem: https://github.com/dblock/heroku-forward/tree/master/lib/heroku/forward/errors - I want something like that. |
I had took a vacation these days, and return to work now, I'll do it this week. : ) |
Hi, I'm doing the all-exception-i18n work.
the error message for missing_vendor_option1 is just the simple 'missing :vendor option.' Just want to make sure I'm on the right way / thanks |
Yep, that's on the right track. |
Closing, thanks @niedhui for the implementation. |
eg:
raise Grape::Exceptions::ValidationError, :status => 400, :param => attr_name, :message => "invalid parameter: #{attr_name}"
can invalid parameter be I18n compatible
The text was updated successfully, but these errors were encountered: