How to load messages (i18n)?

Hi, all!

I have a app, that load fieldnames and labels from doctypes given the user choice, my issue is, the data is loaded fine, but the messages no, I want to know if have a way to send the data and messages from the server to the client?

you can return “__messages” with response.

@sdqadeer44, but how I can load it?

if you are asking, how to append them to frappe._messages, then it is already taken care in the request.js, whenever the response is returned with key "__messages", the messages are appened to the "frappe._messages" and once you call the string with “frappe._” it will return the translated text.

@sdqadeer44, no I’m asking how I can get the translation of a given word from the CSV

@sdqadeer44 I have my answer: https://github.com/frappe/frappe/blob/develop/frappe/translate.py#L252