AnsweredAssumed Answered

Translate in another language than the current language

Question asked by maaube on Nov 12, 2015
Latest reply on Nov 17, 2015 by Matt Marum

I have tricky a use case, where I need to create a custom entity from an opportunity plus some external data. In the opportunity, there's a custom dropdown, whose value will be transferred as text to a textfield in the custom entity. This text value (from the dropdown) has to be in the language of the custom entity, which may or may not be the language of the current user.

 

So, let's say I am connected and my preferred language is english. I need to convert an opportunity to a custom entity, but in french. How do I translate the dropdown value in french?

 

$opportunity = new Opportunity();
$opportunity->retrieve($args['id']);

// How do I translate this?
$value = $GLOBALS['app_list_strings']['custom_dropdown'][$opportunity->custom_dropdown];

Outcomes