I have a JS code that changes the text after some time and I want to use i18next translations in that to make the words "performance, flexibility" etc.. be in more than 1 language. the idea I had to solve this was putting the i18next value inside a variable and substitue the words in the JS code with the variables. but I don't know how to use i18next to put his translated words inside a variable, if someone could help me I would be very grateful!
Json files
en-US
"index" : {
"performance" : " performance",
"flexibility" : "flexibility"
}
pt-PT
"index" : {
"performance" : " Desempenho",
"flexibility" : "Flexibilidade"
}
JS code
var typed1 = new Typed('#typed1', {
strings: ["performance", "flexibility", "scalability."],
typeSpeed: 50,
backSpeed: 20,
smartBackspace: true,
loop: true
});
var typed1 = new Typed('#typed2', {
strings: ["Protection", "Sophisticated", "Flexibility"],
typeSpeed: 100,
backSpeed: 50,
smartBackspace: true,
loop: true
});