I am making ajax request , and I call __('string to translate')
function on backend. The problem is that translate is not working at all.
My ajax controller is implementing HttpPostActionInterface
Interface to avoid massive data load. If I use previous way, i.e extending \Magento\Framework\App\Action\Action
, the translation is working good, however I don't wan't to extend this huge class. Have anybody got idea why HttpPostActionInterface
is not working with translations?
I've tried various things, including this here , however nothing seems to be working. I will do translations on frontend side eventually , but this doesn't explain why translations are missed on this interface?
$response['message'] = __('Translated text');
. The problem is that text is translated if I extend controller with\Magento\Framework\App\Action\Action
, however it does not when controller is only implementingHttpPostActionInterface