Interface: PdfTranslationContext
Translation context passed as the last argument to the product PDF hooks that produce text (ApiPdfConfig.getPdfContent, ApiPdfConfig.getHeader, ApiPdfConfig.getFooter, ApiPdfConfig.getFileName and ApiPdfConfig.pageRenderers).
formatMessage resolves keys from the embed's translations for locale, in this order:
Mimeeq's built-in embed messages, the customer's embed translation set (including
custom. keys) and window.mimeeqCustomMessages.
Example
getFooter: ({ formatMessage }) =>
`<div>${formatMessage({ id: 'custom.pdf.footer', defaultMessage: 'Thank you' })}</div>`
Properties
formatMessage
formatMessage:
FormatMessage
Formats a message by ID with the customer's embed translations for locale.
locale
locale:
string
Language code the PDF is generated in, such as en or de.