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
padma sree 24padma sree 24 

How to use translation custom labels in apex class

Hi Team,

Please help me how to use translation custom labels in apex class. I can able to use translation custom labels in vf page as !$Label.customlabelname but i am not able to use translation custom lables in apex class.
I have tried to use ApexPages.Message myMsg1 = new ApexPages.Message(ApexPages.Severity.ERROR,Label.Error_Message); like this but always i am getting error message in english only not in local languages.

Please help how to use this.

Thanks in advance,
padmasree
 
SaurabhGupta_SaurabhGupta_

Hi Padmasree,

You need to login with another user whose locale = translated language.
Did you check this?

Thanks,

Saurabh