I’m working on returning translated messages in a response, but I’m running into an issue.
Currently, when the Front-end calls a REST process, the response always shows the Dutch translation. (In the architect, we have both English and Dutch translations in the returned error.) For example, here’s a simplified version of the response we get (Error2 is the default error with a ToString() function):
{
"success": true,
"error": {
"Message": "Message11874370"
},
"response": {
"error2": ".......... Controleer de ...... en probeer het opnieuw of neem contact op met de klantenservice."
},
"httpcode": 200
}
We tested this in the expression debugger. I tried the following expressions:
messages:loadtranslated("Message11874370").tostring()
This does not show the translated message.
messages:load("Message11874370").tostring()
This works, but only for the current language, not for translations.
What I want to achieve is that when the Front-end is set to English, the response of the REST process is also in English.
Has anyone solved this before, or is there a specific function/approach to ensure the correct translation is returned in the response?