Answer the question
In order to leave comments, you need to log in
How to translate received data via Ajax?
Good day.
I am receiving data via Ajax in English , how can I display the data translated into another language ?
Do a normal switch
switch (key) {
case first:
name = 'первый'
break;
case second:
name: = 'второй'
break;
default:
break;
}
Answer the question
In order to leave comments, you need to log in
make a dictionary and take values from it
var MESSAGES_RU = {
'error': "ошибка",
'done': "готово"
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question