I have a custom API whose response message is in English. I wanted to convert it to french language when it reaches the frontend. e.g now my API is sending a message as:
if (!strcmp($gcode,$giftcode)) {
result=array();
$result['message']='Gift card already redeemed';
echo json_encode($result);
exit;
}
My backend is Magento 2(English) and the frontend is in Vue Js storefront (French language).
I have used some built-in APIs also, so how can I change their language.
Or the language will be changed by Vue Js storefront when any API (built-in, custom) response is received. Or it should be handled in the backend (Magento 2)?