", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A7YkFSAV", "datePublished": "2014-01-28T01:58:25.000Z", "author": { "@type": "Person", "name": "Vamsi Gosu", "url": "https://trailblazers.salesforce.com/profileView?u=00530000009YMcJAAW", "affiliation": { "@type": "Organization", "name": "TechForce Services" } } } ] } } Skip to main content
Paddy R 님이 #Data Management에 질문했습니다
 I need to get the value of Locale from user object using javascript.

 

Could you please help me on this?

 

 locale value from user object

 

Regards,

 

Paddy
답변 3개
  1. 2014년 1월 28일 오전 1:58
    Paddy,

     

    once you get the locale in your apex controller and assign it to a variable, you can access the same in your javascript.. it will be available on page load..

     

    Apex Controller

     

    Public String UserLocale {get; set;}

     

    public void MyController(){

     

     UserLocale = UserInfo.getLocale();

     

    }

     

    Javascript in your visualforce page

     

    <script>

     

    var userLocale='{!userLocale}';

     

    if(userLocale == 'en-US'){

     

    //do your logic

     

    }

     

    </script>