I'm trying to programatically send a custom email from admin and I need to add some strings before sending the email. I would like to translate these strings based on a language selected. I used the code below but it does not work, the string stays in English.
$localeInterface = $objectManager-
>create('Magento\Framework\Locale\ResolverInterface');
$localeInterface->setLocale('de_DE');
$localeInterface->setDefaultLocale('de_DE');
echo __('Some string');
Thanks !