Orchardcms translate dataannotations error message with for example Q42 translation module

Tags: localization, error messages, dataannotations, Q42 module

For every multilingual website I have built with the OrchardCMS I have used the Q42 translation module. This module makes it possible to add and edit translations for the content manager without coding.
For the website http://mijnfutsalteam.nl, which I'm currenly building, I wanted to use dataannotation errormessages in the viewmodels so I have to define each message only once per viewmodel. The only problem I had was that the messages also so have to be translated because the websites has to support multiple languages. Because It's not very easy to find out how you can manage this in combination with the Q42, here a small tutorial:

I have done this through manual database editing but you can also add the translations to the PO files (http://www.orchardproject.net/localize):

The database row for the localizable record:

Path: system.componentmodel.dataannotations.requiredattribute

Context: System.ComponentModel.DataAnnotations.RequiredAttribute

StringKey: The TeamName field is required.

OriginalLanguageString: The TeamName field is required.

After you've added the localizable record you can find the message in the Q42 search panel:

The result:

I hope it will help you when you are having problems translating error messages in the Orchard CMS amd Q42 translations module.