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

Padrino clobbers ActiveModel error messages in I18n locales #1701

Closed
fj opened this Issue Jun 23, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@fj
Contributor

fj commented Jun 23, 2014

ActiveModel permits one to specify error messages in locales using one of a number of keys. For example, this will provide an error message for presence validations:

en:
  errors:
    messages:
      blank: you screwed this up

However, when you do this in Padrino, you won't see this error message appear during validations. Instead, the original default is used.

It turns out that this may be because padrino-admin is clobbering the messages by loading its own locale data first, even if you aren't using padrino-admin at all.

We had an IRC conversation on the issue which you can see here.

The expected behavior for me is that:

  1. padrino-admin shouldn't load any locales at all, if you're not actually using padrino-admin.
  2. Whether or not you're using padrino-admin, user locales should always trump padrino-admin's locales.
  3. Specifically, your error messages should always win, regardless of what Padrino's loaded.
@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Jun 23, 2014

Contributor

👍. See this too.
I also think that we don't need to override the AR locales into Padrino admin anymore.

The ohm locales should probably stay there as they aren't embedded into the ORM.

/cc @DAddYE

Contributor

dariocravero commented Jun 23, 2014

👍. See this too.
I also think that we don't need to override the AR locales into Padrino admin anymore.

The ohm locales should probably stay there as they aren't embedded into the ORM.

/cc @DAddYE

@DAddYE

This comment has been minimized.

Show comment
Hide comment
@DAddYE

DAddYE Jun 23, 2014

Member

👍

Member

DAddYE commented Jun 23, 2014

👍

@ujifgc ujifgc closed this in #1702 Jul 1, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment