Custom event portal localization in outbound marketing

Note

Dynamics 365 Marketing and Dynamics 365 Customer Insights are now Customer Insights - Journeys and Customer Insights - Data. For more information, see Dynamics 365 Customer Insights FAQs

New Customer Insights - Journeys customers receive real-time journeys features only. For more information, see Default real-time journeys installation.

Important

This article only applies to outbound marketing.

Frontend part

Localization on the frontend part (Angular application) is supported using custom appTranslate directive made for event management application. You can see the usage of the directive throughout the application and the directive implementation itself in the /src/app/components/directives/translate.directive.ts. To add new localized content, you have to apply the directive to the newly added content. If you added a new paragraph for example:

<p>this is my new paragraph</p>

You need to name the label and apply the directive. If you name the label as NewLabel it results in this:

<p [appTranslate]="'NewLabel'">this is my new paragraph</p>

After you add the directive in the code, you need to add the label in your localization files located under /Localization folder. This directory contains a JSON file for each language that is supported. The localization files use the Windows Language Code Identifier (LCID) as naming schema (for example, 1033.json).

To add the translated label, modify the 1033.json file (this file contains all English translations). It contains the labels in the JSON format, so to add the new label you can append the following to the JSON object:

"NewLabel": "this is my new paragraph in English"

After doing this, the resulting paragraph should contain the text this is my new paragraph in English, if you have selected English as a current website language. Since you have added the label for English only, other languages default to the original text this is my new paragraph.

Backend part

The localization files containing labels aren't bundled up with the application themselves. They need to be hosted independently.

If you're using Power Apps portal hosting, then the script DeployToDynamics365Instance.ps1 takes care to put the localization file to the right place. In this case, the localizationEndpoint environment setting points to the localization/ path as shown in the environment.d365.ts sample environment.

If you're using self-hosted, then you need to choose a place to host the files (they can be on the same server as the application), and then you should modify localizationEndpoint environment setting to point to that location.