notGeek
notGeek

Reputation: 1528

Translate Rails Devise error messages

I'm using devise gem to implement authentication in my Ruby On Rails application. Sometimes error messages are displayed such as:

Prohibited an error being wellness saved from this user: Password is too short (minimum is 6 characters)

What is the best way to translate these messages to another language?

Upvotes: 2

Views: 3335

Answers (2)

Paulo B.
Paulo B.

Reputation: 11

The fastest way is downloading a translation file to the language you want. You can find more about in this link.

What you are going to find there is a bunch of files in different languages for Devise flash notifications that you can download and add to you application under config/locales.

Hope that helps you! :)

Upvotes: 1

Ashitaka
Ashitaka

Reputation: 19203

Go to config/locales and copy devise.en.yml, giving the file a name like devise.other_language_initials.yml. Then add your own translations.

For more info on how to translate your application, go here.

Upvotes: 3

Related Questions