Custom, role-aware content translations in Power Pages
Diesen Beitrag auf Deutsch lesen
A Dataverse table, Liquid FetchXML and JavaScript provide custom multilingual labels with role- and page-aware selection in Power Pages.
TL;DR
A custom Power Pages site can store English and French labels in a Dataverse custom table, load active records with Liquid FetchXML into a JavaScript object, and replace elements marked with content-key using the selected language. The pattern supports role- and page/user-property-specific labels, but header caching can return stale or inappropriate content; substitution may be needed.
Original by Alex Shlega, on It Ain't Boring. Read the original
This is our own summary, not a republication or full translation.
Governance takeaway
- Makers: define the content-key and language-selection logic carefully, especially when labels vary by user role or page properties.
- Admins/CoE: govern the custom content table, its associations and deployment approach because business users manage the translation data.
- Security/Compliance: test role matching and header caching, since cached content can interfere with labels selected for signed-in users.
Frequently asked questions
Why does the author use a custom table for texts instead of content snippets?
Snippets may need customization on a custom site rendered with JavaScript and Liquid, and the author finds them hard for translators to manage. A custom table can be maintained in the main model-driven app.
How is the text table structured?
The table holds a name used as the key, an English label and a French label, and the query reads only active records.
What is the downside of this solution?
Because the texts are replaced after the page has loaded, occasional flickering can occur while the original content is still visible.