Skip to content
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 for validator, flash messages #123

Merged
merged 1 commit into from
Aug 1, 2012
Merged

i18n for validator, flash messages #123

merged 1 commit into from
Aug 1, 2012

Conversation

petergoldstein
Copy link
Contributor

This pull request moves the validator messages and flash messages to the locale file. A couple of comments about the pull:

  1. The validator uses the conventions established by the ORM libraries for the localization keys for model related strings.
  2. As a result of (1), each validator message actually appears twice in the locale file - once in the 'activerecord' location and again in the 'mongoid' location. This is unavoidable if we want to support both libraries and follow convention
  3. The flash messages were added using the conventions of the Platformatec responders library (https://github.com/plataformatec/responders). This is as close to a standard convention for Flash messages as I could find.
  4. Because of these changes the RedirectUriValidator spec had to be updated to an integration spec and changed to use an Application factory. It was proving impossible to get ActiveModel to accept a configured name in conjunction with the anonymous class. ActionModel::Naming doesn't really support dynamic naming by its subclasses without a lot of work.

Tests all pass in ActiveRecord and Mongoid.

…al with Mongoid type massaging and convert validators test to integration test.
felipeelias added a commit that referenced this pull request Aug 1, 2012
…dator_and_flash

i18n for validator, flash messages
@felipeelias felipeelias merged commit 67ce47c into doorkeeper-gem:master Aug 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants