web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Set default language for dynamics 365 portal.

(0) ShareShare
ReportReport
Posted on by 45

Hi All,

I have configured a new language(say Hindi) for the portal.

Please guide me that how can I set the second language(Hindi) as a default language as per geo-location.

Example: If a user opens a portal website from the UK, the default language would be English, and if a user from India opens it would be Hindi.

I have the same question (0)
  • Samuel Cavichioli Profile Picture
    on at

    Hi Yash,

    Please, check the following article: Enable multiple-language portal support.

    Regards

  • Suggested answer
    YGupta Profile Picture
    45 on at

    Hi Samuel,

    Thanks for reply,

    As i mentioned i have already configured the language for portals, but now the requirement is to change the language automatically in portal website when a user login from different countries to thier's respective language.

    Like, one appoarch could be to get the default language from the browser and then website should pick the web page of same language.

    So, If you can help me on please suggest how can i achieve this?

    Thanks and regards,

    Yash Gupta

  • Verified answer
    oliver.rodrigues Profile Picture
    4,052 on at

    hi Yash, I must confess I like your requirement

    via JavaScript/HTML5 you can get the geolocation of the user (not sure about browser support, this might not work in old IEs)

    you can paste the below JS code in your console and you will get the longitude/latitude, the browser will prompt for a "location access required" confirmation alert

    after getting lat/long, you will need to call another API (google maps / bing maps or any other) to know where those coordinates are from: developers.google.com/.../map-geolocation

    finally you can redirect to your portal URL with the expected language

    I would set that in a cookie, asking the user if they want to change the language, so that JS would be better placed in the Tracking Code, the reason for this is because a user might be in India and still prefer to view your website in English (and vice-versa)

    function error() {
    console.log( 'Unable to retrieve your location');
    }
    
    function success(position) {
    console.log(position.coords.latitude);
    console.log(position.coords.longitude);
    }
    
    navigator.geolocation.getCurrentPosition(success, error);

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Samuel Cavichioli Profile Picture
    on at

    Hi Yash,

    Currently there is no OOB functionality on Portal that sets automatically the portal language based on user's location.

    After you enable multiple-language, you will now have a dropdown on the main menu to choose the language that you want to view the portal in.

    Note that if you login, you can set your preferred language in the profile page.

    pastedimage1588697257594v3.png

  • YGupta Profile Picture
    45 on at

    Thanks,

    This could be the alternative

  • YGupta Profile Picture
    45 on at

    Hi Oliver,

    What should the trigger point for this console application?

    Kindly explain to me the whole process in step, I have not used console application so far.

    Thanks and Regards,

    Yash Gupta

  • Verified answer
    oliver.rodrigues Profile Picture
    4,052 on at

    Hi, the "console" above, means the browser console and not a console application, how familiar are you with JavaScript/API calls? if not too much my suggested approach would be too difficult then

    Note that the "Preferred Language" lookup in the profile form doesn't set the website language, that's more to be used in workflows/sending e-mails etc.. you can still use that to set the portal language, but if the user is not logged in, you won't have the preferred language

  • YGupta Profile Picture
    45 on at

    Hi Oliver,

    Yes, I am very much familiar with JS and APIs,

    I have used your approach and it is working.

    The only problem I am facing now is that at first, it opens the Portal with English language, then popup asks for location tracking, then after retrieving it is redirecting to the target portal, which is taking the time.

    But I believe it is a good solution,

    Thanks again.

    Regards,

    Yash Gupta

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans