function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SimrinSimrin 

Detect Language in Controller

Hello,

I had error with Date format for people using in France and India.
I changed the page to be <apex:page language="en-IN"
Which solved the issue.

French format mm/dd/yyyy and Indian format dd/mm/yyyy

I am now forced to remove this parameter.

How can i detect the langiuage in controller and do the task
Best Answer chosen by Simrin
ManojjenaManojjena
HI Simrin ,

I think you want to access the current users language in controller .

Try with below code it will help .
 
String userlanguage = UserInfo.getLanguage();
System.debug('*************'+userlanguage );

Let me know if it helps .

Thanks 
Manoj

All Answers

Shashikant SharmaShashikant Sharma
Could you share full code of you VFP ?
 
ManojjenaManojjena
HI Simrin ,

I think you want to access the current users language in controller .

Try with below code it will help .
 
String userlanguage = UserInfo.getLanguage();
System.debug('*************'+userlanguage );

Let me know if it helps .

Thanks 
Manoj
This was selected as the best answer