This is a very common requirement in PowerApps portals where you need to show language specific text to the user. If the portal is in french, then the french text shall be displayed accordingly text for other languages. let’s take a scenario here where you need to take the render language specific text using javascript.
All you need to do is create a content snippet in the respective language
As you can see I have created a snippet in English. Similarly you can create the corresponding snippet in any other language.
While trying to use it in your script you can just use the below language
var customText = “{{ snippets[‘custom_text’] | default: “Sample text” }};
Please observe the use of default filter. Say you enabled Spanish language for your portal but missed creating a content snippet in Spanish language, the one in default shall render. This is a very good way to avoid liquid error if the snippet is missing.
Hope this helps!
Debajit Dutta
(Business solutions MVP)
Discover more from Debajit's Power Apps & Dynamics 365 Blog
Subscribe to get the latest posts sent to your email.