Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Event website default language

(0) ShareShare
ReportReport
Posted on by 455

Hello,

Is it possible to set the default language for the event website depending settings on the event ?

In a multi-lingual environment we would ideally like to have the event portal language be dictated by the contact language. However, as the website displays event details (description, session, etc) from the record, we are confined to creating a language-specific event. In that case, the contact shouldn't open the site in English by default but in the language of the event and then be able to select a different one.

There is a language cookie set "selected-language-lcid" but it defaults to en-US (1033). On the other hand, the event has a field msevtmgt_Language that doesn't seem to be exposed but seems linked to webinars.

Thank you

  • cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Event website default language

    Hi Nikoleta,

    I'm not familiar with Angular and it's hard for me currently,

    We need some time to learn mechanism of the framework, then we could try to display language based on custom field.(such as running labelservice again after event component loaded.)

    But that would not be related to Dynamics Marketing application itself.

    Please feel free to ask any other questions which are involved with Dynamics Marketing application.

    Regards,

    Clofly

  • nikoleta Profile Picture
    nikoleta 455 on at
    RE: Event website default language

    Hi,

    I am coming back to this as I had some time to test the website.

    It is possible to set the DefaultBrowserLcid but that is a constant and would override just the default language.

    A few things that I saw in that labelsservice.ts:

    1. The cookie is set on session and it may be a better option to give it some longer duration. User language is not something that changes very often.

    2. There seems to be a bug when detecting the browser language that prevents it from setting it properly. The navigator.language is a string of the sort "en-US" (example) but then the search of the language is in a collection that has strings like "EnglishUS" (languageToLcidMap). So the default language is always set to English-US. I will see with the Dynamics team if that was intended for some reason.

    3. It would be quite hard to get the language to default to event language (custom field) because as you noted above, the labels.service loads before the event component loads. Actually I wanted to set the event language only initially if the default is not set. True that there could be multiple events but the user would receive an invitation to a specific one that would have the same language as the contact setting ...

    Please send an update if you have any news on the languages subject. Especially for #3

    Thanks

  • Suggested answer
    cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Event website default language

    Hi nikoleta,

    -> Event website uses javascript (navigator.languages) to detect language that user speaking.

    There are 3 core functions(getLcidFromBrowser, getUserLanguage and getUserLcid) in labels.service.ts file to complete such job.

    I tested with self-hosted sample website files, found that we can just change DefaultBrowserLcid variable to set default language.(the default is 1033 English)

    pastedimage1578555730017v1.png

    So you can achieve your requirement by adding a custom optionset field (e.g: Event Language) to Event entity, and try to read this field value in label service.

    (because labelservice will be executed before whole page/elements is loaded.)

    -> Before adding custom code,

    could you help me test if you had changed DefaultBrowserLcid to other number, will your event website(if it's Portal hosted) also change default language as what I've tested?

    There could be some differences between self-hosted code and portal-hosted code, so I would like a confirmation.

    In addtion, I also found that label service will execute once unless I close browser and open the web site again, 

    and due to it'll create cookie into user's browser to save the first time detected language as preference,

    so please clear your browser cache if necessary and test in incognito/private mode to prevent effect from cache.

    -> I have a question, because each event will has a language setting, so how would you do if there are multiple events with different languages in your portal?

    -> Finally, you could try to add code by yourself, all custom fields for event entity will be saved in "customFields" field, 

    this tutorial is about how to add custom field and let it show in event website.

    https://docs.microsoft.com/en-us/dynamics365/marketing/developer/customize-events-api-response

    Regards,

    Clofly

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans