6

I'm integrating SF with other systems using the standard SF API (SOAP and REST). For this, I'm using a specific user which has a special profile (using API Only permission). The Integration user has the Language set on English.

However I need to return the request results on different languages (ES, FR, etc). For instance, the value of picklist should be translated.

Query

Is it possible set on login or in the request the language?

3 Answers 3

3

Results are returned, by default, in the organization's language. Using the toLabel function returns localized values; this is required to support multi-language organizations. In neither case can you specify the translation language to perform transactions in. You would have to update the user's language key before running the transaction.

0
4

I know this is an old question. So I add this comment just to help others that are in my situation. I was struggling to find out how to get translated texts for picklists through the REST API. We already have set up an "SF-Connector" which wraps the REST API so it was not an option to create a new SOAP-version or go this way. What we found was that we could just use the "accept-language"-header, and use the SF-language codes

A curl example:

curl "https://anSFInstance.salesforce.com/services/data/v48.0/ui-api/object-info/FinServ__FinancialGoal__c/picklist-values/[someRecordTypeID]/PP_Goal__c/" -H 'Authorization: Bearer [a bearer token]' -H 'Accept-Language: no'
3

With SOAP API, you can set LocaleOptions in the request header.

LocaleOptions
Specifies the language of the labels returned.

Note that it will only work for certain 'describe' calls. I haven't found a corresponding option for REST.

1
  • I didn't vote you down, but you may find your answers are better received when you include some relevant text from any linked resources.
    – Adrian Larson
    Commented Oct 11, 2017 at 13:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .