For the shipment email, I get the payment info from a third party extension. But the info field names are in English, while the rest of the email is in German. After some bug searching I found that the extension always returns the payment info in the backend locale, which is set to English.
What I want to know is: How does Magento decide which language it uses for translation, when frontend and backend use different languages? Is there a way to keep the backend in English while still using this extension to get the payment info for the shipment email? The same payment info is shown in the backend when viewing order information, so I'd need both translations to work.
This how one of the fields is set in the code:
$data[(string)__('Payment reference:')] = $sTransId;
At that point, $this->area is set to 'frontend', but it seems that this information isn't used.