You need to sign in to do that
Don't have an account?
Wolf Duttlinger 6
Access custom label translation dynamically in APEX based on language - not VF, not user lang
Hi,
I did search but many answers did either simply use the language of the logged-on user or are relevant to VF where you might state the language in the apx:page tag.
I'm coding an APEX REST API. I.e. a class that is being called from external sites. Part of the data that comes in is a language code.
I need to feed back messages from the class. For these messages I did create custom labels in order to be able to use the translation mechanismn build into SF.
Now - in the program - I need to access the label based upon the language specified as a parameter.
I.E. instead of coding:
Any ideas?
I did search but many answers did either simply use the language of the logged-on user or are relevant to VF where you might state the language in the apx:page tag.
I'm coding an APEX REST API. I.e. a class that is being called from external sites. Part of the data that comes in is a language code.
I need to feed back messages from the class. For these messages I did create custom labels in order to be able to use the translation mechanismn build into SF.
Now - in the program - I need to access the label based upon the language specified as a parameter.
I.E. instead of coding:
if ( lang == 'DE') { returnString = 'Ihre Anfrage wurde weitergeleitet. Wir werden uns in Kürze bei Ihnen melden.'; } else { returnString = 'Your request has been forwarded. You will hear from us soon.'; }I want to have something like:
returnString = Label.hppMsg1( 'DE');where hppMsg1 has been defined as a custom label.
Any ideas?