Recently, I had come across a issue which I thought very useful to share with the developers working on WordPress and using WPML for language translations.
Issue: WPML language translation not working in wordpress ajax call
1. Make sure you are passing language variable in with ajax url.
2. Use the following code at the top of the script:
Now, put the below code after your query (if the query does not have to be language specific) or before the query if it has to be language dependent.
You can set the language to its default value by using the following code:
It has been tested and I believe it will solve your problems in getting the translated string usin get text calls like
Please share your thoughts if it was useful for you. Thanks!