Organizing HTML5 form validation i18n

Hi guys!

I’m just starting out making use of the form validation features of HTML5. Our site is not in English, so I need to translate the error messages to maintain a good user experience.

Attaching the various error messages to the correct form element seems simple enough, but to make things maintainable I think I’d prefer to have a single place to define our error messages. Since we already have our Rails i18n file perhaps we can use values from there.

Now I’m wondering if someone here has some clever way of setting this up, or just have some wisdom to share in this area?