
Could you please help me on this?
Regards,
Paddy
답변 3개
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>