2

I have a picklist in my Metadata API :

<fields>
        <fullName>Test__c</fullName>
        <externalId>false</externalId>
        <label>Test</label>
        <picklist>
            <picklistValues>
                <fullName>Car</fullName>
                <default>false</default>
            </picklistValues>
            <picklistValues>
                <fullName>Bus</fullName>
                <default>false</default>
            </picklistValues>
            <sorted>false</sorted>
        </picklist>
        <type>Picklist</type>
    </fields>

I would like to know if it's possible to manage translations for picklist items ? In this example, no matter user language is, it always show 'Car' and 'Bus'.

1 Answer 1

3

In the Metadata API CustomFieldTranslation has a picklistValues field of type PicklistValueTranslation[]. It has a masterLabel and translation string.

So your package.xml for the retrieve call would be something like:

<types>
    <members>*</members>
    <name>CustomObjectTranslation</name>
</types>

You will get something like:

<?xml version="1.0" encoding="UTF-8"?>
<CustomObjectTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
<!-- SNIP... -->
<fields>
    <name>LeadSource</name>
    <picklistValues>
        <masterLabel>Advertisement</masterLabel>
        <translation>Anzeige</translation>
    </picklistValues>
    <picklistValues>
        <masterLabel>Customer Event</masterLabel>
        <translation>Kundenveranstaltung</translation>
    </picklistValues>

You must log in to answer this question.

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