Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Your call to mkMessage creates an instance of the
RenderMessage typeclass, which is the core of Yesod’s i18n. It is defined
as:
classRenderMessagemastermessagewhererenderMessage::master->[Text]-- ^ languages->message->Text
Notice that there are two parameters to the RenderMessage class: the
master site and the message type. In theory, we could skip the master type here, but that would
mean that every site would need to have the same set of translations for each message type. When
it comes to shared libraries like forms, that would not be a workable solution.
The renderMessage function takes a parameter for each of the class’s
type parameters: master and message. The extra parameter is a list of languages the user will
accept, in descending order of priority. The method then returns a user-ready
Text that can be displayed.