rails cancan i18n exception message
I have followed this to write exception handling for cancan. First, I have
a Product model in the "new" action Here is the english locale file:
# in config/locales/en.yml
en:
unauthorized:
manage:
all: "Not authorized to %{action} %{subject}."
The expected result is fine:
Not authorized to new Product.
But my question is now I have another locale ex: .de
# in config/locales/en.yml
de:
unauthorized:
manage:
all: "Non autorisé à %{action} %{subject}."
Then I'll get
Non autorisé à% new Product
What I want is
Non autorisé à nouveau produit.
Temporarily I have to options to achieve this, One is I guess I could just
modify the source code in cancan. The second is append some translated
text to it. But is there something native way?
Thanks
No comments:
Post a Comment