There is currently no supported Custom Labels / Translations API from Apex, the Web Services API, or SOQL that you could use to achieve what you're after (the Map<String,List<String>>
with the master language value as the key). Click here to get this on the Product Management top priorities list!!! (NOTE: there IS a very much insane way that you might be able to achieve this through Apex by doing a PageReference.getContent()
and using a Visualforce Page as a utility to return the desired translated values, but I do not recommend this route at all).
However, I think that you can avoid the need through this by addressing the root cause of your problem: your Web-to-Lead form sending back values in the local language of the user. If you can get the Web-to-Lead form to always send back values to your database in a unified master language, while presenting these options to the user visually in their local language, then your problem is solved.
So, the goal is for your Web-to-Lead form's generated <select>
tag corresponding to the Salesforce Picklist field in question to have child <option>
nodes whose value
attributes are in the Master Language, but whose content / text is in the local language.
Example:
You have a Picklist Field "Do you need a Home Mortgage?" in Salesforce with entries "Yes","No","Very Much". You have translated these into, say, Spanish, with values "Sí","No","Muchíssimo". Now, if your Web-to-Lead form looks like this:
<select id="do-you-need-a-home-mortgage">
<option value="Yes">Sí</option>
<option value="No">No</option>
<option value="Very Much">Muchíssimo</option>
</select>
then you're golden --- your database will be populated appropriately.
So, I'm assuming you're currently populating the text/visible portion of these fields appropriately, so I'm assuming you have access to both the PicklistEntry values and public-facing, translated labels. BUT, if you don't, you can get these from the Web Services API or from within Apex through the DescribeFieldResult
for this Picklist field, and then doing a getPicklistValues()
call.