put i18next value inside variable JS #1762
Unanswered
richardr12
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! 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
});
Beta Was this translation helpful? Give feedback.
All reactions